All Places > Content Retirement & Sandbox Private > Ideas > Ideas

Convert Unix Timestamp

score 160
Voted on 18 times. You have not voted. Active

Hi,

 

there is no Date/Time conversion function for Unix timestamps: http://en.wikipedia.org/wiki/Unix_timestamp

 

In QlikView script a possible implementation to convert from a Unix timestamp to the local time could be:

 

Timestamp = ConvertToLocalTime(Date(MakeDate(1970, 1, 1) + (<timestamp_field> / 86400)), '<time_zone>')

 

or

 

Timestamp = ConvertToLocalTime(Date(25569 + (<timestamp_field> / 86400)), '<time_zone>')

 

The other way convert to a Unix timestamp is also not very easy because there is no function to convert a local time to UTC time:

 

http://community.qlikview.com/message/202269

 

Unix timestamps should be handled by a date/time format definition or some extra functions.

 

- Ralf

Comments

Vote history