Skip to content

Unexpected Date.parse behaviour #963

@willholley

Description

@willholley

QuickJS appears to unexpectedly parse date strings containing epoch seconds, unlike other major JS engines.

For example, attempting to parse string containing "1065873600" (Saturday, October 11, 2003 12:00:00 PM):

qjs > Date.parse("1065873600")
946684800000

946684800000 represents Saturday, January 1, 2000 12:00:00 AM, which is incorrect.

In other JavaScript engines (e.g. SpiderMonkey, V8), Date.parse("1065873600") returns NaN, so I expected similar behavior from qjs.

I appreciate that the specification of Date.parse allows for implementation-specific fallbacks - I just couldn't find a description of the intended behavior so better understand whether this is intended behavior or a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions