How to convert a timestamp column from one timezone to another in the PostgreSQL data source
The Bold BI application allows you to convert the timestamp column in the PostgreSQL data source from one time zone to another.
Steps to convert timestamp column to another time zone
-
Refer to the Connecting Bold BI to PostgreSQL data source documentation for successful connection.
-
Drag and drop the table from the table schema onto the data design view page.
-
Click on the
Expression
icon and choose the timestamp column that needs to be converted to the local time zone, as shown in the following image.
-
Then, add the following code to the timestamp column that needs to be converted from Greenwich Mean Time (GMT) to your local time zone in the Expression editor, as shown in the following image, and click
Save
.AT TIME ZONE 'GMT' AT TIME ZONE '+05:30'
The above sample registers the timestamp column in the GMT format and converts the timestamp into Indian Standard Time(IST).
NOTE: The time difference between GMT and your local time zone should be manually set in the above sample.
-
Click on
Update
and you will find the result, where the created timestamp column in GMT will be converted into Indian Standard Time.
Note: This documentation is applicable to all web data sources in extract mode only, as well as PostgreSQL in live and extract modes in the Bold BI. For MS SQL Server and MySQL data sources, the following expressions should be used to convert the GMT date column to the Indian Standard Time zone.
Data sources Expressions MS SQL Server DATEADD(mi,DATEDIFF(mi, GETUTCDATE(), GETDATE()),[last_requested]) MySQL CONVERT_TZ([last_requested],‘+00:00’,‘+05:30’)