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

DateTime doesn't validates correct? #348

Closed
mskoric opened this issue Jan 16, 2017 · 3 comments
Closed

DateTime doesn't validates correct? #348

mskoric opened this issue Jan 16, 2017 · 3 comments

Comments

@mskoric
Copy link

mskoric commented Jan 16, 2017

hi,

i notice a problem with the "date-time" format.

They guys from spacetelescope say that there example is valid =>
https://spacetelescope.github.io/understanding-json-schema/about.html?highlight=date%20time

but the validator says no :)

input:
...
{
"birthday": "2017-02-22"
}

json_spec
....
"birthday": {
"type": "string",
"format": "date-time"
},

I think your version is correct because RFC3309 doesn't allow that TIME is optional.
I don't know whats correct. Can you gimme a hint?

Greetz,

Majk

@mskoric mskoric changed the title DateTime doesn't valid correct? DateTime doesn't validates correct? Jan 16, 2017
@shmax
Copy link
Collaborator

shmax commented Jan 16, 2017

@mskoric Your interpretation looks correct to me.

@MichalOdchazel
Copy link

MichalOdchazel commented Apr 9, 2019

Hi,
is this correct behavior?

Input: "time": "2019-12-37T10:06:30.857+0200" -> look at the date: 37
Schema: date-time

In JsonSchema\Rfc3339\createFromString return DateTime object with $date value is 2020-01-06 10:06:30.857000

I think this should fall.

@DannyvdSluijs
Copy link
Collaborator

@mskoric in an attempt to cleanup this repo we are trying to filter the issues and see which ones might be closed. Is it safe to assume this is a rather old issue, which sadly was left unanswered, and can be closed? Feel free to close it yourself with some comments if helpful.

@MichalOdchazel what you are seeing is called rollover where the calendar keeps counting days after 2019-12-31. Same applies in PHP when adding a day to the lat day of the month the result will be the first of the next month.

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

No branches or pull requests

4 participants