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: 
oehmemat
Contributor III
Contributor III

Is Daylight Saving time changing the Windows timezone?

Hello all,

does someone know if the Daylight Saving Time changes the Windows Timezone and so the value returned by the timezone() function ?

I would like to define variables for a sql query (Timestamp in UTC) and don't want to set the offset by hand every time the DST changes.

i.e. do I have to write:

=timestamp(monthstart(addmonths(today(),-1))-TimeZone())

or

=timestamp(monthstart(addmonths(today(),-1))-(TimeZone())+DaylightSaving())

to get the local time monthstart in UTC?

Thank you in advance

5 Replies
swuehl
MVP
MVP

Timezone() will return a string, won't it?

I would assume that the behaviour of the returned local time will depend on your server settings, if the 'automatically adjust clock for daylight saving' is enabled or not.

I then would look into the time conversion functions in QV to convert your local time to UTC.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Maybe you should use localtime('UTC') instead of Today().

Anonymous
Not applicable

To get UTC, you could simply use the the UTC() function that returns the timestamp now's UTC.

Anonymous
Not applicable

as both function timezone() nor daylightsaving() allows no Parameter, you can only use them for today.

you are defining previous month (using addmonth). you Need to know if previous month was in or outside

daylightsaving time.

as i had a similiar problem recently, i defined an inline table with the dates in spring and automn (for each year, as my app used several yearsdata). then i expanded my mastercalenader by new field which contains for each day, if this day is in or outside daylight saving

oehmemat
Contributor III
Contributor III
Author

Thank you for your replies. I have to subtract the time offset after applying monthstart(), the function always returns the first day of month, no matter if I use UTC or local time as the parameter.

I will look into the inline table solution.