Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
as you might know there is a function ConvertToLocalTime to convert a UTC/GMT timestamp to local time with the adjustment for daylight savings time.
But, how about the other direction? Why there is no function for this?
In my case I have a local time which I need to convert to UTC without daylight savings time! I know I could preload calendar table with daylight saving offset (how to generate?) or something else. But this would be very disappointing...
ConvertFromLocalTime() would be needed or DaylightSaving([timestamp][,place]).
Any suggestion?
- Ralf
There is a first idea:
I could act like my local time would be in GMT and do this test calculation for daylight saving:
=if( ConvertToLocalTime(<timestamp>, 'Berlin') - ConvertToLocalTime(<timestamp>, 'Berlin', true()) > 0, 'daylight saving', 'not')
But there should be a better way.
- Ralf
Is this relevant to your question?
No, doesn't help.
There is a first idea:
I could act like my local time would be in GMT and do this test calculation for daylight saving:
=if( ConvertToLocalTime(<timestamp>, 'Berlin') - ConvertToLocalTime(<timestamp>, 'Berlin', true()) > 0, 'daylight saving', 'not')
But there should be a better way.
- Ralf
Hi, I have problem with Convert local time function while i using that =Convertlocaltime(Today(),'kolkata') than its returns 4/20/2012 5:37 AM whenerver the current time is 4/20/2012 4:47 PM. Can guide me what is the exact problem. plzzz.
@rakeshcgbsil
It's probably best to create your own thread instead of bringing up old topics.
Check out this thread, http://community.qlik.com/thread/37530.
=ConvertToLocalTime(UTC(),'Kolkata')
Thanks, I had the same problem, how to convert from local time to UTC with and without daylight savings time and this worked for me 🙂
Hi Ralf,
I used the following solution based on your idea to convert to GMT in one step:
TimestampGMT=timestamp(ConvertToLocalTime(TimestampLocal,'GMT') - ConvertToLocalTime(TimestampLocal,'Rome')+TimestampLocal)
This automatically corrects for DaylightsavingTime