Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-6 digit microsecond date time formats #207

Merged
merged 1 commit into from
Jan 6, 2016
Merged

Fix non-6 digit microsecond date time formats #207

merged 1 commit into from
Jan 6, 2016

Conversation

johnnoel
Copy link
Contributor

RFC3339 allows for second fractions to be any length, however PHP's date/time formatting ALWAYS prints them out as 6 digits. This means if a date-time is passed with a < 6 digit second fractional, the FormatConstraint::validateDateTime will fail as the formatted date will contain 6 digits.

E.g. '2000-05-01T12:12:12.123Z' is passed as a date time and is valid. However after parsing, format() will produce '2000-05-01T12:12:12:12.123000Z'.

Fixes issue #145.

RFC3339 allows for second fractions to be any length, however PHP's
date/time formatting ALWAYS prints them out as 6 digits. This means if a
date-time is passed with a < 6 digit second fractional, the
FormatConstraint::validateDateTime will fail as the formatted date will
contain 6 digits.

E.g. '2000-05-01T12:12:12.123Z' is passed as a date time and is valid.
However after parsing, format() will produce
'2000-05-01T12:12:12:12.123000Z'.

Fixes issue #145.
@bighappyface
Copy link
Collaborator

+1

bighappyface added a commit that referenced this pull request Jan 6, 2016
Fix non-6 digit microsecond date time formats
@bighappyface bighappyface merged commit f9e27c3 into jsonrainbow:master Jan 6, 2016
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.

None yet

2 participants