If you want to display report dates in your country’s local time, the following procedure is recommended. The dates stored in the Aranda database are in UTC (Coordinated Universal Time) format. From version 9.23 of the unified database, utilities are offered to be able to perform the respective time transformation.
There is a table where time zones are listed called ADW_TIME_ZONE.
This table contains two columns
ADW_TIME_ZONE
Name | Time Zone Name |
display | Zone-Sensitive Time Shift |
Adjust a report to use local time zones.
The idea is to pass the time zone as a parameter to the query. A parameter must be set in the designer which will be displayed in the report as a combo. When you select a time zone, the parameter value is sent to the database for adjustment.
- Create a parameter in the report that uses the following query:
The “name” field indicates the time zone and “display” shows the corresponding time offset
SELECT name, display FROM ADW_TIME_ZONE
- Parameter Settings
From the report explorer located in the right sidebar of the editor, you can access the list of parameters and define a new one.
- Parameterize the query
To have the database engine automatically execute the correct time zone settings, observe the following TSQL sample statement. Use the AT TIME ZONE transformation where there are dates that you want to adjust. For more information on AT TIME ZONE
SELECT ...
docu_creation_date
AT TIME ZONE 'UTC'
AT TIME ZONE @timezone as HoraLocal,
* FROM AFW_DOCUMENT
In this example @timezone is the name of the time zone that is passed as a parameter, more specifically the value of the “name” field of the query that lists the time zones.
- Pass the time zone parameter to the query
- When you run the report, you can choose the offset that corresponds to your region. The database will automatically transform the date to the required time.
- The dates will be adjusted as indicated, in this example transformed times are shown for Bogotá and Santiago de Chile.