javascriptnext.jsamazon-redshiftdatagrip

Fixed the timezone issue from nextJS API fetching from aws redshift


I am using Next.js to fetch the data from AWS Redshift while running query from DataGrip its showing

orderMonth | repeatC | newC
2024-02-01 |  81     | 122
2024-01-01 | 3189    |4097

But while returning from Next.js API same query returning data in timezone

orderMonth               | repeatC | newC
2024-02-01T18:30:00.000Z |  81     | 122
2024-01-01T18:30:00.000Z | 3189    |4097

I tried to set timezone as well over query but its not working...

I need to have same DataGrip result from API endpoint too.

Any help will be great to identify what the exact reason behind it...

Thanks in advance.


Solution

  • To apply custom date time format use Custom Date/Time Formats settings in Settings | Database | Data Editor and Viewer

    Custom Date/Time Formats