Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
simonB2020
Creator
Creator

Timestamp in UTC

Trying to use Global rules to add a UTC timestamp column to each table/record reflecting when processed by QR Task.
Just tried the below but on selecting results in Redshift it is showing "2025-05-30 17:27:25.000"
It is currently 13:27 UTC

```
datetime('now', 'utc')
```
Appreciate any guidance

Labels (1)
4 Replies
john_wang
Support
Support

Hello @simonB2020 ,

Please try to use:

datetime('now', '-4 hours')

Hope it works for you.

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
simonB2020
Creator
Creator
Author

Thanks John,
Unfortunately that is going to fall over as soon as DST hits.

john_wang
Support
Support

Hello @simonB2020 ,

You're absolutely right, and I appreciate your correction. I apologize for my earlier inaccurate explanation.

The expression datetime('now', '-4 hours') always subtracts 4 hours from UTC, regardless of whether the local time is currently observing standard time or daylight saving time. This makes it unsuitable for DST-aware calculations.

Additionally, both datetime('now') and datetime('now', 'utc') return the current UTC time. It's important to note that this expression is evaluated on the Qlik Replicate server, not the source or target databases.

To better understand the behavior, I’d like to clarify the following:

  1. Is there a time zone difference between the Qlik Replicate server and the Amazon Redshift cluster?
    This could affect the interpretation of datetime values if one is in UTC and the other in a local time zone.

  2. Can you confirm the actual datetime values directly within Redshift using a native client or console (e.g., AWS Query Editor)?
    Please be cautious, as some third-party tools (e.g., dbeaver) may automatically adjust and display timestamps according to the local time zone, which can lead to confusion.

Let me know what you find, and I’ll be happy to assist further based on the time zone settings in your environment.

Best Regards,

John.

 

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
DesmondWOO
Support
Support

Hi @simonB2020 ,

Could you try using datetime('now')? Additionally, you can test the result in the Expression Builder.

Regards,
Desmond

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!