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
Not applicable

ConvertToLocalTime

I am trying to do convert GMT times to local for different time zones. This is what works if I had only one time zone to convert:

=Hour(ConvertToLocalTime(Program_View_Start_Time, 'GMT-05:00'))

How do I define a variable to use instead of 05:00 ?

Thank you in advance

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: ConvertToLocalTime

If my solution is working, can you close the thread by selecting correct answer?

View solution in original post

7 Replies
Highlighted
MVP
MVP

Re: ConvertToLocalTime

Create Two Variables

vVar1 

This variable will take time input as hh:mm or -hh:mm format ... i.e. -02:00 or 03:00

vVar2

=IF(vVar1 < 0, 'GMT'&'-'&TIME(Right(vVar1,5),'hh:mm'),'GMT'&'+'&TIME(vVar1,'hh:mm'))

Now use below

=ConvertToLocalTime(NOW(),vVar2)

Highlighted
Not applicable

Re: ConvertToLocalTime

Thank you so much. It is working for my GMT-3, GMT-4, GMT-5 and GMT-6 conversions. It needs formatting changes for 2 digit subtractions (i.e GMT-10) .

Highlighted
Not applicable

Re: ConvertToLocalTime

This works perfectly as well. Thank you so much Manish

Highlighted
MVP
MVP

Re: ConvertToLocalTime

Just Guessing, is this working for GMT-05:00 or any negative value also?

Highlighted
MVP
MVP

Re: ConvertToLocalTime

Just Guessing, is this working for GMT-05:00 or any negative value also?

Highlighted
Not applicable

Re: ConvertToLocalTime

Azmir, My solution is not perfect, sorry. It will not give possibility to have for example GMT+10:00. Turn off correct answer from my response, please.

Highlighted
MVP
MVP

Re: ConvertToLocalTime

If my solution is working, can you close the thread by selecting correct answer?

View solution in original post