Created
December 5, 2019 17:13
-
-
Save wraithgar/82b7dcbcef29ac695b6e8b6259258c1c to your computer and use it in GitHub Desktop.
ruby strftime/strptime bug
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
require 'date' | |
Date.strptime(Date.new(2006,1,1).strftime('%U-%Y'), '%U-%Y') | |
#<Date: 2006-01-01 ((2453737j,0s,0n),+0s,2299161j)> | |
Date.strptime(Date.new(2000,12,31).strftime('%U-%Y'), '%U-%Y') | |
#<Date: 2000-12-31 ((2451910j,0s,0n),+0s,2299161j)> | |
Date.strptime(Date.new(2001,1,7).strftime('%U-%Y'), '%U-%Y') | |
#<Date: 2001-01-07 ((2451917j,0s,0n),+0s,2299161j)> | |
Date.strptime(Date.new(2001,1,1).strftime('%U-%Y'), '%U-%Y') | |
# Traceback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment