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, " "));
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson