If you have ever needed to create a or translate a java epoch (time in seconds since 1/1/1970) and were lost looking at how to do this then here is the solution:

Convert a date object to epoch:

<cfset epochTime = DateDiff("s", "January 1 1970 00:00", TheDateObject) />

Now change it back:

<cfset theDate = DateAdd("s", epochTime, "January 1 1970 00:00:00") />

Sorry, comments are closed for this article.