Kirix Strata Blog

Converting Julian dates and Unix timestamps

Converting date formats can be a tricky thing.  Two of the more cryptic formats that come up in our support questions relate to Julian dates and Unix timestamps.  Here’s how you convert them in Strata:

Julian Dates

A Julian date is the number of days since January 1, 4713 BC GMT.  To convert a Julian date to the current date, you can simply use DATE(0,0,0) + <number>, where <number> is the Julian date.  For for example, if the number appears as “2454917″, the formula in Strata would be:

date(0,0,0) +  2454917  [the result would be March, 26, 2009]

Unix Timestamps

A unix timestamp is the number of seconds since 1970.  To convert a unix timestamp to the current date, use DATE(<number>), where <number> is the number of milliseconds since 1970.  If the timestamp is given in seconds, multiply by 1000:  DATE(<number>*1000).  So, for example, if you the number appears as “1237657172″, the formula in Strata would be:

date(1238088021 * 1000)  [the result would be March, 26, 2009]

As a side note,  sometimes one might mistake a Julian or Unix date for a different custom format.  For instance, dates could be stored in the format YYDDD or YYYYDDD where YY/YYYY is the year, and DDD is the number of days since the beginning of that year.  So 2001003 would be January 3, 2001

For further information on Strata date conversion, please see this help page.

4 Responses to “Converting Julian dates and Unix timestamps”

  1. JD Edwards Date Conversions (CYYDDD) | Strata Blog says:

    […] Strata Blog « Converting Julian dates and Unix timestamps […]

  2. Elliott says:

    Wonderful work! That is the type of info that should be shared across the net. Disgrace on Google for not positioning this submit upper! Come on over and discuss with my website . Thank you =)

  3. christmas celebrations says:

    What’s up with the comments listed here? Usually I spot a great deal http://www.freechristmasguide.com of considerate stuff here, but all of this seems like nonsense to me. Come on guys, let’s turn it around.

  4. Rodger Dibenedetti says:

    Recent Blogroll Additions……

Leave a Reply