-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
util,test: Use consistent Date representation for util/inspect #4318
Conversation
LGTM but I'd like to get review from others @nodejs/collaborators |
LGTM |
Fix: #4314 PR-URL: #4318 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
Re: nodejs#4314 `Inspect` formats dates in two different ways, depending on whether it has properties or not. No properties and it uses `toString`. https://github.com/nodejs/node/blob/master/lib/util.js#L272 > The toString() method always returns a string representation of > the date in American English. While when properties are present it uses `toUTCString`. https://github.com/nodejs/node/blob/master/lib/util.js#L393 > The format of the return value may vary according to the platform. > The most common return value is a RFC-1123 formatted date stamp, > which is a slightly updated version of RFC-822 date stamps. I am wondering why two different representations are used? And being 2015, it would seem sensible to use `toISOString`. > The toISOString() method returns a string in simplified > extended ISO format (ISO 8601), which is always 24 characters > long: YYYY-MM-DDTHH:mm:ss.sssZ. The timezone is always zero > UTC offset, as denoted by the suffix "Z". ./configure make test Total errors found: 0
LGTM. This should be semver-major? |
Landed in 04af258, thank you! |
@evanlucas it should be, agree |
6b58ad3
to
fa0442c
Compare
@indutny ... thanks for landing... I think for semver-major type things tho we may need to give it a bit more time for review before landing |
I didn't realise that there was a specific format for PRs, sorry about that. |
It seems like this got landed before the commit message was fixed in fa0442c. |
Fix: #4314 PR-URL: #4318 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
I have fixed the commit message. Some time had passed, but it was still the most recent commit. See 93d6b5f. |
Thank you @cjihrig ! I was away. Sorry everyone for confusing and landing it too fast with mistakes :( |
Hey @Xotic750, I believe this is your first commit to core! Thanks for picking up this inconsistency, the change will make it in to v6 in a few months time. Welcome on board! |
@rvagg Yes, this was my first commit. I've been using |
Fix: nodejs#4314 PR-URL: nodejs#4318 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
Re: #4314
Inspect
formats dates in two different ways, depending onwhether it has properties or not.
No properties and it uses
toString
.https://github.com/nodejs/node/blob/master/lib/util.js#L272
While when properties are present it uses
toUTCString
.https://github.com/nodejs/node/blob/master/lib/util.js#L393
I am wondering why two different representations are used?
And being 2015, it would seem sensible to use
toISOString
../configure
make test
Total errors found: 0