Method | NS2 | NS3 | NS4 | NS6 | IE3a | IE3b | IE4 | IE5 | IE5.5 | IE6 |
getDate | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| Returns the day of the month, 1-31. |
| Syntax: date .getDate() . |
getDay | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| Returns the day of the week, 0-6 (where Sunday = 0, and Saturday = 6). |
| Syntax: date .getDay() . |
getFullYear | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Gets the full, four-digit year. |
| Syntax: date .getFullYear() . |
getHours | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| Gets the hour of the day since midnight, 0-]23. |
| Syntax: date .getHours() . |
getMilliseconds | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Returns the milliseconds value in a Date object using local time. |
| Syntax: date .getMilliseconds() . |
getMinutes | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| Returns the minutes value in a Date object using local time. |
| Syntax: date .getMinutes() . |
getMonth | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| Returns the month value, 0-11 (January = 0) in the Date object using local time. |
| Syntax: date .getMonth() . |
getSeconds | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| Returns the seconds value in a Date object using local time. Returns 0-59. |
| Syntax: date .getSeconds() . |
getTime | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| Returns an integer value representing the number of milliseconds between midnight, January 1, 1970 and the time value in the Date object. In the Internet Explorer, the range of dates is approximately 285,616 years from either side of midnight, January 1, 1970. Negative numbers mean dates before 1970. |
| Syntax: date .getTime() . |
getTimezoneOffset | | | | | | | | | | |
| x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| Returns the difference in minutes between the time on the computer and UTC. |
| Syntax: date .getTimezoneOffset() . |
getUTCDate | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Returns the day of the month in a Date object using UTC. Returns 1-31. |
| Syntax: date .getUTCDate() . |
getUTCDay | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Returns the day of the week value in a Date object using UTC. Returns 0-6 (where 0 = Sunday). |
| Syntax: date .getUTCDay() . |
getUTCFullYear | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Returns the four-digit year value in a Date object using UTC. |
| Syntax: date .getUTCFullYear() . |
getUTCHours | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Returns the hours value in a Date object using UTC. returns 0-23. |
| Syntax: date .getUTCHours() . |
getUTCMilliseconds | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Returns the milliseconds value in a Date object using UTC. Returns 0-999. |
| Syntax: date .getUTCMilliseconds() . |
getUTCMinutes | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Returns the minutes value in a Date object using UTC. Returns 0-59. |
| Syntax: date .getUTCMinutes() . |
getUTCMonth | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Returns the month value in a Date object using UTC. Returns 0-11 (January = 0). |
| Syntax: date .getUTCMonth() . |
getUTCSeconds | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Returns the month value in a Date object using UTC. Returns 0-59. |
| Syntax: date .getUTCSeconds() . |
getVarDate | | | | | | | x | x | x | x |
| Returns: Date object |
| Returns the date using VT_DATE format, which you use when interacting with COM objects, ActiveX objects, or other objects that accept and return date values in VT_DATE format in the Internet Explorer. |
| Syntax: date .getVarDate() . |
getYear | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| This method is considered obsolete; use the getFullYear method instead. In the Internet Explorer, for the years 1900 though 1999, the year is a 2-digit integer value returned as the difference between the stored year and 1900. For dates outside that period, the 4-digit year is returned. In the Netscape Navigator, the year is returned as the difference between the stored year and 1900. |
| Syntax: date .getYear() . |
parse | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. The acceptable date formats vary by browser, such as "December 15, 2003 11:20 AM" . |
| Syntax: Date.parse("dateString") . Note that you don't need a Date object here, just the name Date . |
setDate | x | x | x | x | x | x | x | x | x | x |
| Returns: Nothing |
| Sets the day of the month. |
| Syntax: date .setDate( value ) , where value is 1-31. |
setDay | x | x | x | x | x | x | x | x | x | x |
| Returns: Nothing |
| Sets the day of the week. |
| Syntax: date .setDay( value ) , where value is 0-6 (Sunday = 0). |
setFullYear | | | x | x | | x | x | x | x | x |
| Returns: Integer |
| Sets the four-digit year. |
| Syntax: date .setFullYear( year ) , where year is the four-digit year. |
setHours | x | x | x | x | x | x | x | x | x | x |
| Returns: Nothing |
| Sets the hour of the day in 24-hour time. |
| Syntax: date .setHours( value ) , where value is 0-23. |
setMilliseconds | | | x | x | | x | x | x | x | x |
| Returns: Nothing |
| Sets the number of milliseconds. |
| Syntax: date .setMilliseconds( value ) where value is 0-999. |
setMinutes | x | x | x | x | x | x | x | x | x | x |
| Returns: Nothing |
| Sets the number of minutes. |
| Syntax: date .setMinutes( value ) , where value is 0-59. |
setMonth | x | x | x | x | x | x | x | x | x | x |
| Returns: Nothing |
| Sets the month in the date. |
| Syntax: date .setMonth( value ) , where value is 0-11 (January = 0). |
setSeconds | x | x | x | x | x | x | x | x | x | x |
| Returns: Nothing |
| Sets the seconds in the date. |
| Syntax: date .setSeconds( value ) , where value is 0-59. |
setTime | x | x | x | x | x | x | x | x | x | x |
| Returns: Nothing |
| Sets the date and time using a millisecond value. |
| Syntax: date .setTime( value ) , where value is an integer value representing the number of elapsed seconds since midnight, January 1, 1970 Greenwich Mean Time (GMT). |
setUTCDate | | | x | x | | x | x | x | x | x |
| Returns: Nothing |
| Sets the day of the month in the Date object using UTC. |
| Syntax: date .setUTCDate( value ) , where value is 1-31. |
setUTCDay | | | x | x | | x | x | x | x | x |
| Returns: Nothing |
| Sets the day of the week in the Date object using UTC. |
| Syntax: date .setUTCDay( value ) , where value is 0-6 (Sunday = 0). |
setUTCFullYear | | | x | x | | x | x | x | x | x |
| Returns: Nothing |
| Sets the full year in the Date object using UTC. |
| Syntax: date .setUTCFullYear( value ) , where value is the four-digit year. |
setUTCHours | | | x | x | | x | x | x | x | x |
| Returns: Nothing |
| Sets the hour in the Date object using UTC. |
| Syntax: date .setUTCHours( value ) , where value is 0-23 in 24-hour time. |
setUTC Milliseconds | | | x | x | | x | x | x | x | x |
| Returns: Nothing |
| Sets the milliseconds value in the Date object using UTC. |
| Syntax: date .setUTCMilliseconds( value ) , where value is 0-999. |
setUTCMinutes | | | x | x | | x | x | x | x | x |
| Returns: Nothing |
| Sets the minutes value in the Date object using UTC. |
| Syntax: date .setUTCMinutes( value ) , where value is 0-59. |
setUTCMonth | | | x | x | | x | x | x | x | x |
| Returns: Nothing |
| Sets the minutes value in the Date object using UTC. |
| Syntax: date .setUTCMonth( value ) , where value is 0-11 (January = 0). |
setUTCSeconds | | | x | x | | x | x | x | x | x |
| Returns: Nothing |
| Sets the seconds value in the Date object using UTC. |
| Syntax: date .setUTCSeconds( value ) , where value is 0-59. |
setYear | x | x | x | x | x | x | x | x | x | x |
| Returns: Nothing |
| This method is considered obsolete; use setFullYear instead. Sets the year value in the Date object. |
| Syntax: date .setYear( value ) , where value is the year. |
toDateString | | | | | | | | | x | x |
| Returns: String |
| Returns a (browser-dependent) string holding the date. |
| Syntax: date .toDateString() . |
toGMTString | x | x | x | x | x | x | x | x | x | x |
| Returns: String |
| Returns a (browser-dependent) string holding the GMT date. |
| Syntax: date .toGMTString() . |
toLocaleString | | | | x | | | | | x | x |
| Returns: String |
| Returns a (browser-dependent) string holding the local date in local format. |
| Syntax: date .toLocaleString() . |
toLocaleDateString | | | | x | | | | | x | x |
| Returns: String |
| Returns a (browser-dependent) string holding the local date in UTC format. |
| Syntax: date .toLocaleDateString() . |
toLocaleTimeString | | | | x | | | | | x | x |
| Returns: String |
| Returns a (browser-dependent) string holding the local time in local format. |
| Syntax: date .toLocaleTimeString() . |
toString | x | x | x | x | x | x | x | x | x | x |
| Returns: String |
| Returns a (browser-dependent) string holding the local time. |
| Syntax: date .toString() . |
toTimeString | | | | x | | | | | x | x |
| Returns: String |
| Returns a (browser-dependent) string holding the time. |
| Syntax: date .toTimeString() . |
toUTCString | | | x | x | | x | x | x | x | x |
| Returns: String |
| Returns the date converted to a string using UTC. |
| Syntax: date .toUTCString() . |
UTC | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| Returns the number of milliseconds between midnight, January 1, 1970 UTC (or GMT) and the given date. |
| Syntax: Date.UTC( year , month , day [, hours [, minutes [, seconds [, ms ]]]]) . Note that you don't need a Date object here, just the Date name. |
valueOf | | x | x | x | | | x | x | x | x |
| Returns: String |
| Returns the date converted to a string using UTC. |
| Syntax: date .valueOf() . |