Created
December 19, 2012 22:40
-
-
Save coldfumonkeh/4341230 to your computer and use it in GitHub Desktop.
Handling Twitter's "interesting" date format in ColdFusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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