Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
MK_QSL
MVP
MVP

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

View solution in original post

7 Replies
MK_QSL
MVP
MVP

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)

Not applicable
Author

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) .

Not applicable
Author

This works perfectly as well. Thank you so much Manish

MK_QSL
MVP
MVP

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

MK_QSL
MVP
MVP

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

Not applicable
Author

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.

MK_QSL
MVP
MVP

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