Skip to content

Instantly share code, notes, and snippets.

@coldfumonkeh
Created December 19, 2012 22:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coldfumonkeh/4341230 to your computer and use it in GitHub Desktop.
Save coldfumonkeh/4341230 to your computer and use it in GitHub Desktop.
Handling Twitter's "interesting" date format in ColdFusion
<cffunction name="parseTwitterDateFormat" output="false" returntype="String" hint="I return the date in a useable date format.">
<cfargument name="twitterDate" required="true" type="string" hint="The Twitter date." />
<cfset var formatter = CreateObject("java", "java.text.SimpleDateFormat").init("EEE MMM d kk:mm:ss Z yyyy") />
<cfset formatter.setLenient(true) />
<cfreturn formatter.parse(arguments.twitterDate) />
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment