Skip to content

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.

2 participants