Date
Overview
The javascript Date implementation.
For more information see: Date (MDN).
Methods Summarized
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
The value returned by the getTime method is the number of milliseconds since 1 January 1970 00:00:00.
Takes a date string (such as "Dec 25, 1995") and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC.
Methods Detailed
UTC(year, month)
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Parameters
Returns: Number
Sample
// The number of milliseconds in the first minute after 1970 January 1st.
application.output(Date.UTC(1970, 00, 01, 00, 01, 00, 00)); // prints: 60000.0
UTC(year, month, date)
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Parameters
Number year A year after 1900.
Number month A number between 0 and 11.
Number date A number between 1 and 31.
Returns: Number
Sample
// The number of milliseconds in the first minute after 1970 January 1st.
application.output(Date.UTC(1970, 00, 01, 00, 01, 00, 00)); // prints: 60000.0
UTC(year, month, date, hrs)
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Parameters
Number year A year after 1900.
Number month A number between 0 and 11.
Number date A number between 1 and 31.
Number hrs A number between 0 and 23.
Returns: Number
Sample
// The number of milliseconds in the first minute after 1970 January 1st.
application.output(Date.UTC(1970, 00, 01, 00, 01, 00, 00)); // prints: 60000.0
UTC(year, month, date, hrs, min)
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Parameters
Number year A year after 1900.
Number month A number between 0 and 11.
Number date A number between 1 and 31.
Number hrs A number between 0 and 23.
Number min A number between 0 and 59.
Returns: Number
Sample
// The number of milliseconds in the first minute after 1970 January 1st.
application.output(Date.UTC(1970, 00, 01, 00, 01, 00, 00)); // prints: 60000.0
UTC(year, month, date, hrs, min, sec)
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Parameters
Number year A year after 1900.
Number month A number between 0 and 11.
Number date A number between 1 and 31.
Number hrs A number between 0 and 23.
Number min A number between 0 and 59.
Number sec A number between 0 and 59.
Returns: Number
Sample
// The number of milliseconds in the first minute after 1970 January 1st.
application.output(Date.UTC(1970, 00, 01, 00, 01, 00, 00)); // prints: 60000.0
UTC(year, month, date, hrs, min, sec, ms)
Takes comma-delimited date parameters and returns the number of milliseconds between January 1, 1970, 00:00:00, universal time and the specified time.
Parameters
Number year A year after 1900.
Number month A number between 0 and 11.
Number date A number between 1 and 31.
Number hrs A number between 0 and 23.
Number min A number between 0 and 59.
Number sec A number between 0 and 59.
Number ms A number between 0 and 999.
Returns: Number
Sample
// The number of milliseconds in the first minute after 1970 January 1st.
application.output(Date.UTC(1970, 00, 01, 00, 01, 00, 00)); // prints: 60000.0
getDate()
Gets the day of month in local time
Returns: Number
Sample
date.getDate();
getDay()
Gets the day of the week (sunday = 0) in local time
Returns: Number
Sample
date.getDay();
getFullYear()
Gets the full year of the date in local time
Returns: Number
Sample
date.getFullYear();
getHours()
Gets the hours of the date in local time
Returns: Number
Sample
date.getHours();
getMilliseconds()
Gets the milliseconds of the date in local time
Returns: Number
Sample
date.getMilliseconds();
getMinutes()
Gets the minutes of the date in local time
Returns: Number
Sample
date.getMinutes();
getMonth()
Gets the month of the date in local time
Returns: Number
Sample
date.getMonth();
getSeconds()
Gets the seconds of the date in local time
Returns: Number
Sample
date.getSeconds();
getTime()
The value returned by the getTime method is the number of milliseconds since 1 January 1970 00:00:00.
Returns: Number
Sample
date.getTime();
getTimezoneOffset()
Gets the number of minutes between GMT and this date.
Returns: Number
Sample
date.getTimezoneOffset();
getUTCDate()
Gets the UTC date.
Returns: Number
Sample
date.getUTCDate();
getUTCDay()
Gets the day in UTC time.
Returns: Number
Sample
date.getUTCDay();
getUTCFullYear()
Gets the full year in UTC time.
Returns: Number
Sample
date.getUTCFullYear();
getUTCHours()
Gets the hours in UTC time.
Returns: Number
Sample
date.getUTCHours();
getUTCMilliseconds()
Gets the milliseconds in UTC time.
Returns: Number
Sample
date.getUTCMilliseconds();
getUTCMinutes()
Gets the minutes in UTC time.
Returns: Number
Sample
date.getUTCMinutes();
getUTCMonth()
Gets the month in UTC time.
Returns: Number
Sample
date.getUTCMonth();
getUTCSeconds()
Gets the seconds in UTC time.
Returns: Number
Sample
date.getUTCSeconds();
now()
Returns the milliseconds elapsed since 1 January 1970 00:00:00 UTC up until now.
Returns: Number
Sample
var timestamp = Date.now();
parse(s)
Takes a date string (such as "Dec 25, 1995") and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC.
Parameters
String s The date string to parse
Returns: Number
Sample
var str = Date.parse("Wed, 09 Aug 1995 00:00:00 GMT");
application.output(str);
setDate(dayValue)
Sets the date.
Parameters
Number dayValue ;
Returns: void
Sample
date.setDate(integer);
setFullYear(yearValue)
Sets the full year of the date.
Parameters
Number yearValue ;
Returns: void
Sample
date.setFullYear(integer);
setFullYear(yearValue, monthValue)
Sets the full year of the date.
Parameters
Returns: void
Sample
date.setFullYear(integer);
setFullYear(yearValue, monthValue, dayValue)
Sets the full year of the date.
Parameters
Returns: void
Sample
date.setFullYear(integer);
setHours(hoursValue)
Sets the hours of the date.
Parameters
Number hoursValue ;
Returns: void
Sample
date.setHours(integer);
setHours(hoursValue, minutesValue)
Sets the hours of the date.
Parameters
Returns: void
Sample
date.setHours(integer);
setHours(hoursValue, minutesValue, secondsValue)
Sets the hours of the date.
Parameters
Returns: void
Sample
date.setHours(integer);
setHours(hoursValue, minutesValue, secondsValue, msValue)
Sets the hours of the date.
Parameters
Returns: void
Sample
date.setHours(integer);
setMilliseconds(millisecondsValue)
Sets the milliseconds of the date.
Parameters
Number millisecondsValue ;
Returns: void
Sample
date.setMilliseconds(integer);
setMinutes(minutesValue)
Sets the minutes of the date.
Parameters
Number minutesValue ;
Returns: void
Sample
date.setMinutes(integer);
setMinutes(minutesValue, secondsValue)
Sets the minutes of the date.
Parameters
Returns: void
Sample
date.setMinutes(integer);
setMinutes(minutesValue, secondsValue, msValue)
Sets the minutes of the date.
Parameters
Returns: void
Sample
date.setMinutes(integer);
setMonth(monthValue)
Sets the month of the date.
Parameters
Number monthValue ;
Returns: void
Sample
date.setMonth(integr);
setMonth(monthValue, dayValue)
Sets the month of the date.
Parameters
Returns: void
Sample
date.setMonth(integr);
setSeconds(secondsValue)
Sets the seconds of the date.
Parameters
Number secondsValue ;
Returns: void
Sample
date.setSeconds(integer);
setSeconds(secondsValue, msValue)
Sets the seconds of the date.
Parameters
Returns: void
Sample
date.setSeconds(integer);
setTime(timeValue)
Sets the milliseconds of the date.
Parameters
Number timeValue ;
Returns: void
Sample
date.setTime(integer);
setUTCDate(dayValue)
Sets the UTC date.
Parameters
Number dayValue ;
Returns: void
Sample
date.setUTCDate(integer);
setUTCFullYear(yearValue)
Sets the year in UTC time.
Parameters
Number yearValue ;
Returns: void
Sample
date.setUTCFullYear(integer);
setUTCFullYear(yearValue, monthValue)
Sets the year in UTC time.
Parameters
Returns: void
Sample
date.setUTCFullYear(integer);
setUTCFullYear(yearValue, monthValue, dayValue)
Sets the year in UTC time.
Parameters
Returns: void
Sample
date.setUTCFullYear(integer);
setUTCHours(hoursValue)
Sets the hours in UTC time.
Parameters
Number hoursValue ;
Returns: void
Sample
date.setUTCHours(integer);
setUTCHours(hoursValue, minutesValue)
Sets the hours in UTC time.
Parameters
Returns: void
Sample
date.setUTCHours(integer);
setUTCHours(hoursValue, minutesValue, secondsValue)
Sets the hours in UTC time.
Parameters
Returns: void
Sample
date.setUTCHours(integer);
setUTCHours(hoursValue, minutesValue, secondsValue, msValue)
Sets the hours in UTC time.
Parameters
Returns: void
Sample
date.setUTCHours(integer);
setUTCMilliseconds(millisecondsValue)
Sets the milliseconds in UTC time.
Parameters
Number millisecondsValue ;
Returns: void
Sample
date.setUTCMilliseconds(integer);
setUTCMinutes(minutesValue)
Sets the minutes in UTC time.
Parameters
Number minutesValue ;
Returns: void
Sample
date.setUTCMinutes(integer);
setUTCMinutes(minutesValue, secondsValue)
Sets the minutes in UTC time.
Parameters
Returns: void
Sample
date.setUTCMinutes(integer);
setUTCMinutes(minutesValue, secondsValue, msValue)
Sets the minutes in UTC time.
Parameters
Returns: void
Sample
date.setUTCMinutes(integer);
setUTCMonth(monthValue)
Sets the month in UTC time.
Parameters
Number monthValue ;
Returns: void
Sample
date.setUTCMonth(integer);
setUTCMonth(monthValue, dayValue)
Sets the month in UTC time.
Parameters
Returns: void
Sample
date.setUTCMonth(integer);
setUTCSeconds(secondsValue)
Sets the seconds in UTC time.
Parameters
Number secondsValue ;
Returns: void
Sample
date.setUTCSeconds(integer);
setUTCSeconds(secondsValue, msValue)
Sets the seconds in UTC time.
Parameters
Returns: void
Sample
date.setUTCSeconds(integer);
toDateString()
Returns a string version of the date.
Returns: String
Sample
date.toDateString();
toISOString()
Returns a string version of the UTC value of the date.
Returns: String the Date object as a string in simplified extended ISO format.
Sample
date.toISOString();
toLocaleDateString()
Returns a string version of the local time zone of the date.
Returns: String
Sample
date.toLocaleDateString();
toLocaleString()
Returns a string version of the local time zone of the date.
Returns: String
Sample
date.toLocaleString();
toLocaleTimeString()
Returns a string version of the local time zone of the date.
Returns: String
Sample
date.toLocaleTimeString();
toTimeString()
Returns a string version of the date.
Returns: String
Sample
date.toTimeString();
toUTCString()
Returns a string version of the UTC value of the date.
Returns: String
Sample
date.toUTCString();
valueOf()
Return integer milliseconds count
Returns: Number
Sample
date.valueOf(integer);
Last updated
Was this helpful?