How Can I Interpret The Date Timestamp?

  • 7011096
  • 26-Jan-2011
  • 19-Oct-2012

Resolution

This comes from a question received from the field:  I am working to create a reporting system based upon your data export tables. For the date fields, the format is numeric (19,0), but we are unable to determine how to change this to a date readable value in our reports. Would you please let us know how you are converting the date/time stamp into this numeric field, so we can reverse it back to an understandable date/time value.

Answer:

The date value you see is the result of the java.util.Date().getTime() method. This an epoch time that is the number of milliseconds from a Julian date (Janurary 1, 1970, IIRC). There are a number of ways to convert it. Below are a few programmatic methods. You may find additional information by doing an internet search.

Via Java:

long value = 1291304299819L; // an example date value in milliseconds
java.util.Date d = new java.util.Date(value);
String humanReadableDate = d.toString();
System.out.println(humanReadableDate);

Via Perl:

my ($stamp) = 1291304299819; # an example date value in milliseconds
$stamp = $stamp / 1000;
my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($stamp);
$year+=1900;
printf "time is: %02d/%02d/%d %02d:%02d:%02d\n",$mon+1,$mday,$year,$hour,$min,$sec;

Via the Access Governance Suite Console:

(11:02:43.31)() c:\
$ cd \test_installs\iiq5042\WEB-INF\bin
(11:05:21.12)() c:\test_installs\iiq5042\WEB-INF\bin
$ iiq console
> date 1291304299819
Thu Dec 02 09:38:19 CST 2010
>