.. _Date: ================================================ Date ================================================ Description ----------- A date/time object. Constructors ^^^^^^^^^^^^ +---------------------------------+--------------------------------------------------------------+ | :ref:`Date` readonly | Returns a new Date object holding the current date and time. | +---------------------------------+--------------------------------------------------------------+ Methods ^^^^^^^ +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getDate` readonly | Returns the day of the month of the specified Date object in local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getDay` readonly | Returns the day of the week for the specified Date object in local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getFullYear` readonly | Returns the four digit year of the specified Date object in local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getHours` readonly | Returns the hour of the specified Date object in local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getMilliseconds` readonly | Returns the milliseconds of the specified Date object in local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getMinutes` readonly | Returns the minutes of the specified Date object in local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getMonth` readonly | Returns the month of the specified Date object in local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getSeconds` readonly | Returns the seconds of the specified Date object in local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getTime` readonly | Returns the number of milliseconds since midnight January 1,1970 UTC for the specified Date object. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getTimezoneOffset` readonly | Returns the difference in minutes between the computer's local time and UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getUTCDate` readonly | Returns the day of the month of the specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getUTCDay` readonly | Returns the day of the week for the specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getUTCFullYear` readonly | Returns the four digit year of the specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getUTCHours` readonly | Returns the hour of the specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getUTCMilliseconds` readonly | Returns the milliseconds of the specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getUTCMinutes` readonly | Returns the minutes of the specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getUTCMonth` readonly | Returns the month of the specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getUTCSeconds` readonly | Returns the seconds of the specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`getYear` readonly | Returns the year of the specified Date object, as a difference from 1900, in local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setDate` readonly | Sets the day of the month of a specified Date object according to local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setFullYear` readonly | Sets the year of a specified Date object according to local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setHours` readonly | Sets the hours of a specified Date object according to local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setMilliseconds` readonly | Sets the milliseconds of a specified Date object according to local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setMinutes` readonly | Sets the minutes of a specified Date object according to local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setMonth` readonly | Sets the month of a specified Date object according to local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setSeconds` readonly | Sets the seconds of a specified Date object according to local time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setTime` readonly | Sets the date of a specified Date object in milliseconds since midnight, January 1, 1970. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setUTCDate` readonly | Sets the date of a specified Date object according to universal time. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setUTCFullYear` readonly | Sets the year of a specified Date object according to UTC, can also set the month and date. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setUTCHours` readonly | Sets the hours of a specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setUTCMilliseconds` readonly | Sets the milliseconds of a specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setUTCMinutes` readonly | Sets the minutes of a specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setUTCMonth` readonly | Sets the month of a specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setUTCSeconds` readonly | Sets the seconds of a specified Date object according to UTC. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`setYear` readonly | Sets the year of a specified Date object according to local time, as a difference between the current year and 1900. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toDateString` readonly | | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toGMTString` readonly | | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toLocaleDateString` readonly | | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toLocaleString` readonly | | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toLocaleTimeString` readonly | | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toSource` readonly | Creates a string representation of this object that can be fed back to?eval()?to re-create an object. Works only with built-in classes. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toString` readonly | Returns a string value representing the date and time stored in the Date object in human readable format. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toTimeString` readonly | | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`toUTCString` readonly | | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`valueOf` readonly | The valueOf() method returns the number of milliseconds that have passed since midnight, Returns an integer. | +-------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ Static Methods ^^^^^^^^^^^^^^ +-----------------------------------+------------------------------------------------------------------------------------------------------------------+ | :ref:`UTC` readonly | Returns the number of milliseconds between midnight January 1, 1970, UTC, and the specified time. | +-----------------------------------+------------------------------------------------------------------------------------------------------------------+ | :ref:`parse` readonly | Parses a string, returning a new Date object. The string should be similar to the string returned bt toString(). | +-----------------------------------+------------------------------------------------------------------------------------------------------------------+ .. container:: hide .. toctree:: :hidden: :maxdepth: 1 Date/getDate.rst Date/getDay.rst Date/getYear.rst Date/getFullYear.rst Date/getHours.rst Date/getMilliseconds.rst Date/getMinutes.rst Date/getMonth.rst Date/getSeconds.rst Date/getTime.rst Date/getTimezoneOffset.rst Date/getUTCDate.rst Date/getUTCDay.rst Date/getUTCFullYear.rst Date/getUTCHours.rst Date/getUTCMilliseconds.rst Date/getUTCMinutes.rst Date/getUTCMonth.rst Date/getUTCSeconds.rst Date/setDate.rst Date/setFullYear.rst Date/setHours.rst Date/setMilliseconds.rst Date/setMinutes.rst Date/setSeconds.rst Date/setMonth.rst Date/setUTCDate.rst Date/setUTCFullYear.rst Date/setUTCHours.rst Date/setUTCMilliseconds.rst Date/setUTCMinutes.rst Date/setUTCSeconds.rst Date/setUTCMonth.rst Date/setTime.rst Date/setYear.rst Date/toDateString.rst Date/toTimeString.rst Date/toLocaleString.rst Date/toLocaleDateString.rst Date/toLocaleTimeString.rst Date/toGMTString.rst Date/toUTCString.rst Date/toString.rst Date/valueOf.rst Date/toSource.rst Date/parse.rst Date/UTC.rst Date/Date.rst