Skip to content

Instantly share code, notes, and snippets.

@fuksito
Created July 18, 2013 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuksito/6029615 to your computer and use it in GitHub Desktop.
Save fuksito/6029615 to your computer and use it in GitHub Desktop.
DateTime bug
> "2011-01-01".to_datetime.strftime("%Y%U")
=> "201100"
> DateTime.strptime("201100", "%Y%U")
ArgumentError: invalid date
> DateTime.strptime("201101", "%Y%U")
=> Sun, 02 Jan 2011 00:00:00 +0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment