Skip to content

Instantly share code, notes, and snippets.

@ymendel
Created November 18, 2010 21:21
Show Gist options
  • Save ymendel/705647 to your computer and use it in GitHub Desktop.
Save ymendel/705647 to your computer and use it in GitHub Desktop.
>> t = Time.now
=> Thu Nov 18 15:19:32 -0600 2010
>> ts = t.strftime('%Y-%m-%dT%H:%M:%S%z')
=> "2010-11-18T15:19:32-0500"
>> Time.parse(ts)
=> Thu Nov 18 14:19:32 -0600 2010
>> ts = t.strftime('%Y-%m-%dT%H:%M:%S%Z')
=> "2010-11-18T15:19:32CST"
>> Time.parse(ts)
=> Thu Nov 18 15:19:32 -0600 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment