How to convert a Unix timestamp to a date in Cognos 8

Technote (troubleshooting)


Problem(Abstract)

How can I convert a Unix timestamp to a date in Cognos 8

Resolving the problem

This can be achieved by using a Query Calculation with the following Expression Definition:

_add_days(1970-01-01, (UnixTimeStamp / 60 / 60 / 24))

For example:

_add_days(1970-01-01, (1222128000 / 60 / 60 / 24))

will return September 23rd 2008.

It is also possible to supply a negative number to return dates prior to 1970:

_add_days(1970-01-01, (-108086400 / 60 / 60 / 24))

will return July 30th 1966.


Related information

Unix Time at Wikipedia
Unix Timestamp to Date/Date to Unix Timestamp Converter

Cross reference information
Segment Product Component Platform Version Edition
Business Analytics Cognos Business Intelligence Report Studio Solaris, Windows 8.3

Historical Number

1041358

Document information


More support for:

Cognos 8 Business Intelligence
Report Studio

Software version:

8.3, 8.4, 8.4.1, 10.1, 10.1.1

Operating system(s):

Solaris, Windows

Reference #:

1343316

Modified date:

2014-08-11

Translate my page

Content navigation