Skip to content

Instantly share code, notes, and snippets.

@sgharms
Created March 30, 2012 05:58
Show Gist options
  • Save sgharms/2247121 to your computer and use it in GitHub Desktop.
Save sgharms/2247121 to your computer and use it in GitHub Desktop.
1.9.3p125 :070 > date => "03/26/2012 08:08:34 UTC"
1.9.3p125 :074 > DateTime.strptime(date,"%m/%d/%Y %H:%M:%S %Z").to_s => "2012-03-26T08:08:34+00:00"
1.9.3p125 :076 > DateTime.strptime(date,"%m/%d/%Y %H:%M:%S %z").strftime("%a %b %e %l:%M:%S %Z %Y")
=> "Mon Mar 26 8:08:34 +00:00 2012"
But I want...
Mon Mar 26 08:08:34 UTC 2012
I seem to be missing a tiny something....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment