devbox@COMPUTEC The Computec development blog

8Jul/100

ColdFusion: Get date from Unix timestamp

A quick followup on a previous post ColdFusion UDF to get Unix timestamp from date: Here's a oneliner that provides you with the complimentary function to get a date from a Unix timestamp - as I've discovered that the dateAdd() route mostly recommended on the net not only suffers from being quite clumsy, the result is off by one hour, too - at least when DST is on.

So to get a date from a Unix timestamp in ColdFusion, you can use this oneliner:

<cfset dtMyDate = createObject('java','java.util.Date').init(javaCast('long',iUnixTS*1000)) />

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.