Skip to main content

Module date

Module date 

Source
Expand description

JavaScript Date (global constructor). A Date is a plain object tagged @@native = "Date" whose time value (milliseconds since the Unix epoch, or NaN for an invalid date) lives in a hidden @@ms field.

The surface is implemented in full: getTime/valueOf, the toISOString/toUTCString/toString/toDateString/toTimeString renderings, the toLocale* forms with their options (crate::datefmt), the field getters, the component SETTERS, the Annex-B getYear/setYear, and the statics Date.now/Date.parse/Date.UTC. Local time is the process’s zone, read through localtime_r as node reads TZ.

Constants§

INSTANCE_METHODS
Every method instance_call below answers. valueOf and toString are on this list because Object.prototype has methods by those names too: without the entry, host::call_method hands a Date to object_builtin_method and date.valueOf() returns the Date itself instead of its time value (so +d and d - 0 were NaN).
STATIC_METHODS

Functions§

construct
new Date(...).
instance_call
Date instance methods.
static_call
Date.now() / Date.parse(str) / Date.UTC(...).