Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Partner
Partner

Convert to GMT with DST adjustment

Hi Community,

I need to convert two types of Eastern time - with and without DST adjustment - to GMT.

I'm using ConvertToLocalTime function with opposite offset to achieve it. It works fine without DST


   ConvertToLocalTime([Time Local], 'GMT+05:00',-1)


However, when I change last parameter to 0, It doesn't change anything.


   ConvertToLocalTime([Time Local], 'GMT+05:00',0)


The interesting thing is, if I try to use 'GMT-', e.g. like this


   ConvertToLocalTime([Time Local], 'GMT-05:00',0)


DST adjustment works fine, however it is not the timezone I need.


Any ideas how to achieve it?
Thanks

1 Solution

Accepted Solutions
Highlighted

Re: Convert to GMT with DST adjustment

ConvertToLocalTime() Converts a UTC or GMT timestamp to local time as a dual value [pasted from the Help]

Whereas what you are trying to do is the opposite, as in converting a local time to GMT.

Also GMT [aka UTC] does not have daylight saving.  Always best to use a major city for the time zone, e.g. 'New York' as cities do have daylight saving.  Also different cities also change to DST on different days of the year.  Fiji for reasons best know to them a few years back decided to change their DST in November and mid January which seemed to catch most people out.

Qlik for some reason best know to them does not have a ConvertFromLocalTime() function which makes what you are trying to do less than easy.

Have a look at this thread, How to convert from local time? - it may give you some inspiration.

View solution in original post

3 Replies
Highlighted
Not applicable

Re: Convert to GMT with DST adjustment

i think you can use

ConvertToLocalTime([Time Local], 'GMT+05:00') and

ConvertToLocalTime([Time Local], 'GMT+04:00')

Highlighted

Re: Convert to GMT with DST adjustment

ConvertToLocalTime() Converts a UTC or GMT timestamp to local time as a dual value [pasted from the Help]

Whereas what you are trying to do is the opposite, as in converting a local time to GMT.

Also GMT [aka UTC] does not have daylight saving.  Always best to use a major city for the time zone, e.g. 'New York' as cities do have daylight saving.  Also different cities also change to DST on different days of the year.  Fiji for reasons best know to them a few years back decided to change their DST in November and mid January which seemed to catch most people out.

Qlik for some reason best know to them does not have a ConvertFromLocalTime() function which makes what you are trying to do less than easy.

Have a look at this thread, How to convert from local time? - it may give you some inspiration.

View solution in original post

Highlighted
Partner
Partner

Re: Convert to GMT with DST adjustment

Thank you Bill, Ralf's solution from that old thread helps me