OnDemand User Group

Support Forums => MP Server => Topic started by: tjspencer2 on April 28, 2015, 02:34:26 PM

Title: How to convert db2 loaddate value to meaningful date
Post by: tjspencer2 on April 28, 2015, 02:34:26 PM
Does anyone know how to convert a loaddate into the data a report was loaded?
Title: Re: How to convert db2 loaddate value to meaningful date
Post by: Frederick Tybalt on April 29, 2015, 12:12:56 AM
use the utility arsdate

http://www-01.ibm.com/support/knowledgecenter/SSEPCD_9.5.0/com.ibm.ondemand.administeringmp.doc/arsdate.htm?lang=en
Title: Re: How to convert db2 loaddate value to meaningful date
Post by: Justin Derrick on April 29, 2015, 04:15:06 AM
While using the arsdate command is preferred, the number represents the number of days since January 1st, 1970, UTC.

Programmatically, you can convert to UNIX epoch time format (number of seconds since January 1st, 1970, UTC) by simply multiplying by 86400 (the number of seconds in a day).  From there, you can use standard UNIX utilities to convert into human readable date/time formats.

If your load date is larger than 99999, then it's likely a date format, which is simply the same as UNIX epoch time format.

CMOD v9 and v9.5 can use internal database timestamps, which are generally presented in human-readable formats when queried in the database.

-JD.