Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rohitk1609
Master
Master

how ConvertToLocalTime works ?

Hi techies,

I got  a use case where I need to convert the UTC time to Sydney. If I check in QMC task trigger , Sydney times falls in GMT+10:00 time zone.

Because of day light saving, if you check on Google it says Sydney is 11 hours ahead than UTC.

lets say now it is   8:30 PM at UTC which is 7:30 AM in Sydney, today

but when I use ConvertToLocalTime(now(), 'GMT+10:00', False) then it gives 6:30 AM. I believe day light saving is not working properly in ConvertToLocalTime function. now() gives current time of UTC

 

Can you please tell me why day light saving is not working?

Thanks,

Rohit

Labels (1)
7 Replies
siddhuraj
Contributor
Contributor

Hi Rohit,

Try this,

Date(ConvertToLocalTime(Now(),'Sydney'),'hh:mm TT');

rohitk1609
Master
Master
Author

Yes it is working fine but not for geographies. 

I tried:

=Date(ConvertToLocalTime(Now(),'Belgium'),'hh:mm TT')

=Date(ConvertToLocalTime(Now(),'Switzerland'),'hh:mm TT')

My question is as per Qlik help page we should use GMT+10 not Sydney for Sydney time one, why Sydney is working not GMT+10 second can we have a list like Sydney, what other name this function supports ?

Thanks,

Rohit

rohitk1609
Master
Master
Author

One more thing,

Day light saving is working for =Date(ConvertToLocalTime(now(),'Sydney',false()),'hh:mm TT') but not working for 

=Date(ConvertToLocalTime(now(),'Central America',false()),'hh:mm TT')

 

If I change False to true in argument , 1 hour difference changes  for Sydney but not for Central America

Please have a look

 

Thanks,

Rohit

siddhuraj
Contributor
Contributor

 We can use places for ConvertToLocalTime() function.

The supported places are listed in the qlik help page   converttolocaltime  

As per the page, Belgium and Switzerland are not valid places for use in ConvertToLocalTime() function.

Geeks
Contributor II
Contributor II

Can you please try the expression without using False ?
rohitk1609
Master
Master
Author

I picked one name from Qlik help page and run below experession:

=Date(ConvertToLocalTime(now(),'Central Time (US & Canada)',false()),'hh:mm TT')

=Date(ConvertToLocalTime(now(),'Central Time (US & Canada)',true()),'hh:mm TT')

the point is both expressions are giving same result no matter I ignore day light saving or not,

Can you please explain what extactly is happening ?

Thanks,

Rohit

rohitk1609
Master
Master
Author

Guys,

Did you tested above expression at your side ?

 

Thanks,

Rohit