Well, I've used it mostly to translate POP dates (the kind that come in
email headers) into "standard" date formats.

-----Original Message-----
From: Jim McAtee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 01, 2001 4:27 PM
To: CF-Talk
Subject: ParseDateTime()


What exactly is the use of this function?  I've found that it only works on
a string if the string passes the IsDate() validation function.  Now, if the
string passes that test, then it's _already_ a date.  So, what does parsing
the string accomplish?

The only thing that occurs to me is that in CF's "typeless" variable
environment, CF is really keeping track of variable types behind the scenes.
So by explicitly converting the string to a date variable, maybe you gain
some efficiency in not making CF implicitly convert variables.  I dunno.

<cfset x = "January 31, 2001 18:23:04">

<cfif IsDate(x)>
  <cfset thedate = ParseDate(x)>
  <cfoutput>
  #DateFormat(thedate, "dd-mmm-yy")# #TimeFormat(thedate, "h:mm::ss tt")#
  </cfoutput>
<cfselse>
  The string entered is not a valid date/time.
</cfif>


Jim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to