Skip to content

Conversation

@blaet
Copy link

@blaet blaet commented Sep 8, 2014

Calling the parser would result in the milliseconds being discarded by DateTime#civil:

1.9.3-p547 :003 > DateTime.civil(2010,1,1,1,2,3,123000)
 => #<DateTime: 2010-01-01T01:02:03+00:00 ((2455198j,3723s,0n),+0s,2299161j)>

Now they are correctly set:

1.9.3-p547 :004 > DateTime.civil(2010,1,1,1,2,3.123)
 => #<DateTime: 2010-01-01T01:02:03+00:00 ((2455198j,3723s,123000000n),+0s,2299161j)>

As an added bonus, this also works around a bug in the JRuby implementation of DateTime#civil, where the last argument must be the timezone offset. Whereas MRI just ignores an incorrect offset argument.

trevorrowe added a commit that referenced this pull request Oct 3, 2014
Fixes millisecond parsing in custom DateTime parser
@trevorrowe trevorrowe merged commit ffc9eb5 into aws:master Oct 3, 2014
@trevorrowe
Copy link
Contributor

Sorry for the slow response. We've been nose down on the 2.0 stable release of aws-sdk-core and the preview release of aws-sdk-resources. This should go out with the next release.

@blaet blaet deleted the fix_millisecond_parsing branch October 3, 2014 06:11
trevorrowe added a commit that referenced this pull request Oct 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants