develop wherever and whenever you want...
Docs > Date Class Summary

Date Class Summary

The date class provides an implementation to date time functions in JavaScript.

object Date(value) 
Construct a date object for a given value. value is the number of milliseconds since January 1st, 1970 UTC.

object Date(year,month[,day,hours,mins,secs,ms]) 
Construct a date representing a given year, month, day, and time. Each argument after month can be optionally supplied and defaults are assumed if not supplied.

object Date() 
Construct a date object corresponding to the current date and time.

object Date.parse(string) 
Return a date object corresponding to the string. The typical format for the string is YYYY-MM-DDTHH:mm::ss.sssZ. YYYY is the year from 0000 to 9999. MM is the month from 01 (January) to 12 (December). DD is the day of the month from 01 to 31. HH is the hours from 00 to 24. mm is the number of minutes from 00 to 59. ss is the number of seconds from 00 to 59. sss is the number of milliseconds. Z is used to specify UTC time or + or - is given with a UTC timezone offset in the format +HH:mm or -HH:mm.

number Date.UTC(year,month[,day,hours,mins,secs,ms]) 
Return the number of milliseconds since Jan 1st 1970 UTC given year, month, day, and time. Each argument after month can be optionally supplied and defaults are assumed if not supplied.

number Date.now() 
Return the number of milliseconds since Jan 1st 1970 UTC given current date and time.

string toString() 
Returns string representation of a date in the format YYYY-MM-DDTHH:mm::ss.sssZ.

string toDateString() 
Returns string representation of a date in the format YYYY-MM-DD.

string toTimeString() 
Returns string representation of a date in the format HH:mm::ss.sss.

string toLocaleString() 
Returns string representation of a date in the format YYYY-MM-DDTHH:mm::ss.sssZ.

string toLocaleDateString() 
Returns string representation of a date in the format YYYY-MM-DD.

string toLocaleTimeString() 
Returns string representation of a date in the format HH:mm::ss.sss.

number valueOf() 
Return the number of milliseconds since Jan 1st, 1970 UTC.

number getTime() 
Return the number of milliseconds since Jan 1st, 1970 UTC.

number getFullYear() 
Return the full year for the date in local time.

number getUTCFullYear() 
Return the full year for the date in UTC time.

number getMonth() 
Return the month for the date in local time.

number getUTCMonth() 
Return the month for the date in UTC time.

number getDate() 
Return the month day for the date in local time.

number getUTCDate() 
Return the month day for the date in UTC time.

number getDay() 
Return the week day for the date in local time.

number getUTCDay() 
Return the week day for the date in UTC time.

number getHours() 
Return the hours for the date in local time.

number getUTCHours() 
Return the hours for the date in UTC time.

number getMinutes() 
Return the minutes for the date in local time.

number getUTCMinutes() 
Return the minutes for the date in UTC time.

number getSeconds() 
Return the seconds for the date in local time.

number getUTCSeconds() 
Return the seconds for the date in UTC time.

number getMilliseconds() 
Return the milliseconds for the date in local time.

number getUTCMilliseconds() 
Return the milliseconds for the date in UTC time.

number getTimezoneOffset() 
Return the difference between local time and UTC in minutes.

number getHours() 
Return the hours for the date in local time.

void setTime(time) 
Set the time on the date object to a given time in milliseconds since Jan 1st, 1970 UTC.

void setMilliseconds(ms) 
Set the milliseconds on the date object in local time.

void setUTCMilliseconds(ms) 
Set the milliseconds on the date object in UTC time.

void setSeconds(s) 
Set the seconds on the date object in local time.

void setUTCSeconds(s) 
Set the seconds on the date object in UTC time.

void setMinutes(m) 
Set the minutes on the date object in local time.

void setUTCMinutes(m) 
Set the minutes on the date object in UTC time.

void setHours(h) 
Set the hours on the date object in local time.

void setUTCHours(h) 
Set the hours on the date object in UTC time.

void setDate(d) 
Set the day of month on the date object in local time.

void setUTCDate(d) 
Set the day of month on the date object in UTC time.

void setMonth(m) 
Set the month on the date object in local time.

void setUTCMonth(m) 
Set the month on the date object in UTC time.

void setFullYear(y) 
Set the year on the date object in local time.

void setUTCFullYear(y) 
Set the year on the date object in UTC time.

string toUTCString() 
Return the string representation of the date object in UTC time.

string toISOString() 
Return the string representation of the date object in UTC time in ISO format.

string toJSON(key) 
This method is not supported in Jasic.