CFLib.org – Common Function Library Project

parseCMSDatetime(cmsDatetime)

Last updated January 26, 2006

author

Peter J. Farrell

Version: 1 | Requires: CF5 | Library: DateLib

Description:
Takes a CVS $Date: $ keyword data or SVN $LastChangedDate: $ keyword data and returns a CF datetime object.

Return Values:
Returns a date and time.

Example:

<cfset variables.lastChangedDateString = "$LastChangedDate: 2005/10/26 14:02:01 -0500 (Wed, 26 Oct 2005) $" />

<cfdump var="#parseCMSDatetime(variables.lastChangedDateString)#">

Parameters:

Name Description Required
cmsDatetime Datetime value from SVN/CVS. Yes

Full UDF Source:

/**
 * Parses a CMS (SVN or CVS) datetime into a CF datetime object.
 * 
 * @param cmsDatetime 	 Datetime value from SVN/CVS. (Required)
 * @return Returns a date and time. 
 * @author Peter J. Farrell (pjf@maestropublishing.com) 
 * @version 1, January 26, 2006 
 */
function parseCMSDatetime(cmsDatetime) {
	// Replace all /'s that CVS uses with -'s
	return LSParseDatetime(replace(listGetAt(arguments.cmsDatetime, 2, " "), "/", "-", "ALL") & " " & listGetAt(arguments.cmsDatetime, 3, " "));
}
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