The Date object in JavaScript.
var myObjectVariable = new Date(DateInfo)
Here are the various possibilities for DateInfo:
(). The current local date and time.(milliseconds). Milliseconds since midnight 01 January, 1970 UTC.(DateString). Usual date strings such as "February 28, 1969", "Mon, 25 Dec 1995 13:30:00 GMT", "Mon, 25 Dec 1995 13:30:00 GMT+0430". A given year yields that exact year except for values 0-99 which return 1900-1999, and negative values which return NaN.(intYear, intMonth, intDay[, intHour[, intMinutes[, intSeconds[, intMilliseconds]]]]). Note that intMonth is zero based, i.e. 0=Jan, 1=Feb, etc..constructor. Specifies the function that created an object's prototype. See Object.constructor..prototype. Represents the prototype for this class. You can use the prototype to add properties or methods to all instances of a class.
.getX(). These methods get/retrieve some portion of its date object. The variations include: Date, Day, FullYear, Hours, Milliseconds, Minutes, Month, Seconds, Time, TimezoneOffset, UTCDate, UTCDay, UTCFullYear, UTCHours, UTCMilliseconds, UTCMinutes, UTCMonth, UTCSeconds, and Year. Note that .getTime() returns milliseconds since midnight 01 January, 1970 UTC for the given Date object.
Most JavaScript functions are 0 based. This has no weirdness for most things (EG: .getHours() returns 0-23) with the following exceptions (and their UTC counterparts):
- .getDate() returns 1-31
- .getDay() returns 0-6 where 0=Sunday.
- .getMonth() returns 0-11 where 0=January.
.parse(DateString). Returns milliseconds since midnight 01 January, 1970 UTC for the given datetime string.
.now(). Returns milliseconds since midnight 01 January, 1970 UTC for the system date and time.
.setX(). These methods set/specify some portion of its date object. The variations include: Date, Day, FullYear, Hours, Milliseconds, Minutes, Month, Seconds, Time, TimezoneOffset, UTCDate, UTCDay, UTCFullYear, UTCHours, UTCMilliseconds, UTCMinutes, UTCMonth, UTCSeconds, and Year.
.toY(). These methods usually translate its date object to a real world string. The variations include: GMTString, LocaleString, Source, String, and UTCString.
.UTC(intYear, intMonth[, intDay[, intHour[, intMinutes[, intSeconds[, intMilliseconds]]]]]). Returns milliseconds since midnight 01 January, 1970 UTC.
.valueOf(). Returns milliseconds since midnight 01 January, 1970 UTC.
Try to use the FullYear variations instead of Year variations.
2007-08-08 17:58:30Z