Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
Maybe you should use localtime('UTC') instead of Today().
To get UTC, you could simply use the the UTC() function that returns the timestamp now's UTC.
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
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.