Skip to content

Instantly share code, notes, and snippets.

@dchentech
Created March 9, 2012 02:43
Show Gist options
  • Save dchentech/2004712 to your computer and use it in GitHub Desktop.
Save dchentech/2004712 to your computer and use it in GitHub Desktop.
parse nginx $time_local in ruby
DateTime.strptime("08/Mar/2012:11:53:53 +0800", "%d/%b/%Y:%H:%M:%S %z")
# => Thu, 08 Mar 2012 11:53:53 +0800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment