CFLib.org – Common Function Library Project

millisecondsToDate(strMilliseconds)

Last updated May 20, 2005

author

Steve Parks

Version: 1 | Requires: CF6 | Library: DateLib

Description:
MillisecondsToDate will convert milliseconds (such as timestamps returned by Java objects) and convert them into CF friendly date timestamps.

Return Values:
Returns a date.

Example:

MillisecondsToDate(1095982571858)<BR>
<cfoutput>#MillisecondsToDate(1095982571858)#</cfoutput>

Parameters:

Name Description Required
strMilliseconds The number of milliseconds. Yes

Full UDF Source:

<!---
 Converts epoch milleseconds to a date timestamp.
 
 @param strMilliseconds 	 The number of milliseconds. (Required)
 @return Returns a date. 
 @author Steve Parks (steve@adeptdeveloper.com) 
 @version 1, May 20, 2005 
--->
<cffunction name="millisecondsToDate" access="public" output="false" returnType="date">
	<cfargument name="strMilliseconds" type="string" required="true">
	
	<cfreturn dateAdd("s", strMilliseconds/1000, "january 1 1970 00:00:00")>
</cffunction>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson