Skip to content

new Date('yyyy-m-d') gives incorrect result #20680

@borgsmidt

Description

@borgsmidt
  • v10.1.0:
  • Darwin Kernel Version 17.5.0: root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64:
  • new Date():
// Correct
> new Date('2018-02-01')
2018-02-01T00:00:00.000Z

// Incorrect
> new Date('2018-2-1')
2018-01-31T23:00:00.000Z

// Consistent with first example
> new Date('2018-12-12')
2018-12-12T00:00:00.000Z

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions