IBM Support

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

Technote (troubleshooting)


Problem(Abstract)

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

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

Historical Number

1041358

Document information

More support for: Cognos Business Intelligence
Cognos Administration

Software version: 10.2, 10.2.1, 10.2.2

Operating system(s): AIX, HP-UX, Linux, Solaris

Software edition: Edition Independent

Reference #: 1343316

Modified date: 13 March 2017


Translate this page: