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

util,test: Use consistent Date representation for util/inspect #4318

Closed
wants to merge 1 commit into from

Commits on Dec 17, 2015

  1. util,test: Use consistent Date representation for util/inspect

    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
    Xotic750 committed Dec 17, 2015
    Configuration menu
    Copy the full SHA
    fa0442c View commit details
    Browse the repository at this point in the history