Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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

View solution in original post

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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