Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

praveenavelagap
Contributor III

milliseconds to PST

hi,

I could able to convert milliseconds to UTC/GMT  date and time using

Date((MakeDate(1970, 1, 1) +round(millisecondtime/1000)/(60*60*24))) as [Date-UTC],

      time(millisecondtime/(1000*60*60*24),'hh:mm:ss')as [Time-UTC] 

but I need to show in PST ;only to show lagging in 8 hours from UTC; I tried to convert UTC into PST by 

                                

                         ConvertToLocalTime([Time-UTC],'UTC-08:00')  gives me correct time but not date... can some one help me with this?

for example

milliseconds

1389400952247 -----> Jan 10, 2014 16:42:32 should be in PST

1 Solution

Accepted Solutions

Re: milliseconds to PST

Works for me:

=ConvertToLocalTime(

Date((MakeDate(1970, 1, 1) +round(1389400952247/1000)/(60*60*24)))

,'UTC-08:00')

returns 10/01/2014 16:42:32 here

=ConvertToLocalTime(

Date((MakeDate(1970, 1, 1) +round(1389400952247/1000)/(60*60*24)))

,'UTC')

returns 11/01/2014 00:42:32

And that's 8 hours later than 16:42:32 and means it's just a bit past midnight and thus the next day.


talk is cheap, supply exceeds demand
1 Reply

Re: milliseconds to PST

Works for me:

=ConvertToLocalTime(

Date((MakeDate(1970, 1, 1) +round(1389400952247/1000)/(60*60*24)))

,'UTC-08:00')

returns 10/01/2014 16:42:32 here

=ConvertToLocalTime(

Date((MakeDate(1970, 1, 1) +round(1389400952247/1000)/(60*60*24)))

,'UTC')

returns 11/01/2014 00:42:32

And that's 8 hours later than 16:42:32 and means it's just a bit past midnight and thus the next day.


talk is cheap, supply exceeds demand
Community Browser