JavaScript Date Object
JavaScript Date Object
HOME
HTML
C SS
JAVASC RIPT
JQUERY
XML
ASP.NET
PHP
SQL
MORE...
R EFER ENC ES
EXAMPLES
FO R UM
ABO UT
More C ustom Hosting From A Trusted Source. 24x7 Support. C hat Now.
Like
87k
JavaScript Reference
Overview
WEB HOSTING
Best Web Hosting eUK Web Hosting UK Reseller Hosting Domain, Hosting & Email Lowest Price Hosting
JavaScript Objects
JS Array JS Boolean JS Date JS Math JS Number JS String JS RegExp JS Global
Date Object
The Date object is used to work with dates and times. Date objects are created with new Date(). There are four ways of instantiating a date:
WEB BUILDING
XML Editor - Free Trial! FREE Website BUILDER FREE Website C reator Best Website Templates
Browser Objects
Window Navigator Screen History Location
STATISTICS
Browser Statistics OS Statistics Display Statistics
HTML Objects
DOM Anchor DOM Area DOM Base DOM Body DOM Button DOM Form DOM Frame/IFrame DOM Frameset DOM Image DOM Input Button DOM Input Checkbox DOM Input File DOM Input Hidden DOM Input Password DOM Input Radio DOM Input Reset DOM Input Submit DOM Input Text DOM Link DOM Meta DOM Object DOM Option DOM Select DOM Style DOM Table DOM td / th DOM tr DOM Textarea
www.w3schools.com/jsref/jsref_obj_date.asp
1/3
10/3/13
Sets the milliseconds of a date object Set the minutes of a date object Sets the month of a date object Sets the seconds of a date object Sets a date and time by adding or subtracting a specified number of milliseconds to/from midnight January 1, 1970 Sets the day of the month of a date object, according to universal time Sets the year of a date object, according to universal time (four digits) Sets the hour of a date object, according to universal time Sets the milliseconds of a date object, according to universal time Set the minutes of a date object, according to universal time Sets the month of a date object, according to universal time Set the seconds of a date object, according to universal time Deprecated. Use the setFullYear() method instead Converts the date portion of a Date object into a readable string Deprecated. Use the toUTCString() method instead Returns the date as a string, using the ISO standard Returns the date as a string, formatted as a JSON date Returns the date portion of a Date object as a string, using locale conventions Returns the time portion of a Date object as a string, using locale conventions Converts a Date object to a string, using locale conventions Converts a Date object to a string Converts the time portion of a Date object to a string Converts a Date object to a string, according to universal time Returns the number of milliseconds in a date string since midnight of January 1, 1970, according to universal time Returns the primitive value of a Date object
setUTCDate() setUTCFullYear() setUTCHours() setUTCMilliseconds() setUTCMinutes() setUTCMonth() setUTCSeconds() setYear() toDateString() toGMTString() toISOString() toJSON() toLocaleDateString() toLocaleTimeString() toLocaleString() toString() toTimeString() toUTCString() UTC()
valueOf()
Previous
Next Reference
A ds by s afes aver
Top 10 Tutorials
HTML Tutorial HTML5 Tutorial C SS Tutorial C SS3 Tutorial JavaScript Tutorial jQuery Tutorial SQL Tutorial PHP Tutorial ASP.NET Tutorial XML Tutorial
Top 10 References
HTML/HTML5 Reference C SS 1,2,3 Reference C SS 3 Browser Support JavaScript HTML DOM XML DOM PHP Reference jQuery Reference ASP.NET Reference HTML C olors
Examples
HTML Examples C SS Examples XML Examples JavaScript Examples HTML DOM Examples jQuery Examples XML DOM Examples AJAX Examples Razor Examples ASP Examples SVG Examples
Quizzes
HTML Quiz HTML5 Quiz XHTML Quiz C SS Quiz JavaScript Quiz jQuery Quiz XML Quiz ASP Quiz PHP Quiz SQL Quiz
Color Picker
Statistics
Browser Statistics Browser OS Browser Display
RE P O RT E RRO R
HO ME
TO P
P RI N T
FO RU M
A BO U T
A D V E RT I SE WI T H U S
www.w3schools.com/jsref/jsref_obj_date.asp
2/3
10/3/13
www.w3schools.com/jsref/jsref_obj_date.asp
3/3