PDA

View Full Version : Forums example, lastpost date format



crxtech
25 Apr 2008, 11:03 AM
I'm trying to pass in my own JSON to the forum example with ColdFusion, but I can't figure out what format the date is in. In the PHP example the date is returned like this: "lastpost":"1209124853". I tried passing the date back formatted mmddyyhhss, which worked, but the dates are not right...

So, my question is, what date format is this: 1209124853?

25 Apr 2008, 11:26 AM
unix epoch?

crxtech
25 Apr 2008, 12:36 PM
Thanks, this bit of code will convert the date in coldfusion:


<cfscript>
function GetEpochTime(datetime)
{
return DateDiff("s", DateConvert("utc2Local", "January 1 1970 00:00"), datetime);
}
</cfscript>

<!--- get epoch using java. Note that result is in milliseconds --->
<cfset javaEpoch=now()>

<cfoutput>
#int(GetEpochTime(now()))#
</cfoutput>