Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
String #to_time and #to_datetime: handle fractional seconds [#864 sta…
…te:resolved]
- Loading branch information
Showing
3 changed files
with
11 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
1d93464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ruby 1.8.6 and prior, date.rb has a bug wherein fractional seconds above 59 result in an invalid date. Try a "2005-02-27T23:50:59.275038".to_datetime and you'll see what I mean. Should we hack this to ignore fractional seconds above 59 when on broken ruby versions? It's kind of annoying when a method only works 59 times out of 60.
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/23501
1d93464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ruby 1.8.6 and prior, date.rb has a bug wherein fractional seconds above 59 result in an invalid date. Try a "2005-02-27T23:50:59.275038".to_datetime and you'll see what I mean. Should we hack this to ignore fractional seconds above 59 when on broken ruby versions? It's kind of annoying when a method only works 59 times out of 60.
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/23501
1d93464
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gah, sorry for the double post. /me fails at github