public class Date extends Objs
Objs.Constructor<T extends Objs>, Objs.Property<T>
Modifier | Constructor and Description |
---|---|
|
Date() |
|
Date(double value) |
|
Date(double year,
double month) |
|
Date(double year,
double month,
double date) |
|
Date(double year,
double month,
double date,
double hours) |
|
Date(double year,
double month,
double date,
double hours,
double minutes) |
|
Date(double year,
double month,
double date,
double hours,
double minutes,
double seconds) |
|
Date(double year,
double month,
double date,
double hours,
double minutes,
double seconds,
double ms) |
protected |
Date(Objs.Constructor<?> c,
Object js) |
|
Date(String value) |
Modifier and Type | Method and Description |
---|---|
static Date |
$as(Object obj) |
double |
getDate()
Gets the day-of-the-month, using local time.
|
double |
getDay()
Gets the day of the week, using local time.
|
double |
getFullYear()
Gets the year, using local time.
|
double |
getHours()
Gets the hours in a date, using local time.
|
double |
getMilliseconds()
Gets the milliseconds of a Date, using local time.
|
double |
getMinutes()
Gets the minutes of a Date object, using local time.
|
double |
getMonth()
Gets the month, using local time.
|
double |
getSeconds()
Gets the seconds of a Date object, using local time.
|
double |
getTime()
Gets the time value in milliseconds.
|
double |
getTimezoneOffset()
Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).
|
double |
getUTCDate()
Gets the day-of-the-month, using Universal Coordinated Time (UTC).
|
double |
getUTCDay()
Gets the day of the week using Universal Coordinated Time (UTC).
|
double |
getUTCFullYear()
Gets the year using Universal Coordinated Time (UTC).
|
double |
getUTCMilliseconds()
Gets the milliseconds of a Date object using Universal Coordinated Time (UTC).
|
double |
getUTCMinutes()
Gets the minutes of a Date object using Universal Coordinated Time (UTC).
|
double |
getUTCMonth()
Gets the month of a Date object using Universal Coordinated Time (UTC).
|
double |
getUTCSeconds()
Gets the seconds of a Date object using Universal Coordinated Time (UTC).
|
double |
getUTCHours()
Gets the hours value in a Date object using Universal Coordinated Time (UTC).
|
static String |
newDate() |
static double |
now() |
static double |
parse(String s)
Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
|
double |
setDate(double date)
Sets the numeric day-of-the-month value of the Date object using local time.
|
double |
setFullYear(double year)
Sets the year of the Date object using local time.
|
double |
setFullYear(double year,
double month)
Sets the year of the Date object using local time.
|
double |
setFullYear(double year,
double month,
double date)
Sets the year of the Date object using local time.
|
double |
setHours(double hours)
Sets the hour value in the Date object using local time.
|
double |
setHours(double hours,
double min)
Sets the hour value in the Date object using local time.
|
double |
setHours(double hours,
double min,
double sec)
Sets the hour value in the Date object using local time.
|
double |
setHours(double hours,
double min,
double sec,
double ms)
Sets the hour value in the Date object using local time.
|
double |
setMilliseconds(double ms)
Sets the milliseconds value in the Date object using local time.
|
double |
setMinutes(double min)
Sets the minutes value in the Date object using local time.
|
double |
setMinutes(double min,
double sec)
Sets the minutes value in the Date object using local time.
|
double |
setMinutes(double min,
double sec,
double ms)
Sets the minutes value in the Date object using local time.
|
double |
setMonth(double month)
Sets the month value in the Date object using local time.
|
double |
setMonth(double month,
double date)
Sets the month value in the Date object using local time.
|
double |
setSeconds(double sec)
Sets the seconds value in the Date object using local time.
|
double |
setSeconds(double sec,
double ms)
Sets the seconds value in the Date object using local time.
|
double |
setTime(double time)
Sets the date and time value in the Date object.
|
double |
setUTCDate(double date)
Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCFullYear(double year)
Sets the year value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCFullYear(double year,
double month)
Sets the year value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCFullYear(double year,
double month,
double date)
Sets the year value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCMilliseconds(double ms)
Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCMinutes(double min)
Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCMinutes(double min,
double sec)
Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCMinutes(double min,
double sec,
double ms)
Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCMonth(double month)
Sets the month value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCMonth(double month,
double date)
Sets the month value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCSeconds(double sec)
Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCSeconds(double sec,
double ms)
Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCHours(double hours)
Sets the hours value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCHours(double hours,
double min)
Sets the hours value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCHours(double hours,
double min,
double sec)
Sets the hours value in the Date object using Universal Coordinated Time (UTC).
|
double |
setUTCHours(double hours,
double min,
double sec,
double ms)
Sets the hours value in the Date object using Universal Coordinated Time (UTC).
|
String |
toDateString()
Returns a date as a string value.
|
String |
toISOString()
Returns a date as a string value in ISO format.
|
String |
toJSON()
Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.
|
String |
toJSON(Object key)
Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.
|
String |
toLocaleDateString()
Returns a date as a string value appropriate to the host environment's current locale.
|
String |
toLocaleString()
Returns a value as a string value appropriate to the host environment's current locale.
|
String |
toLocaleTimeString()
Returns a time as a string value appropriate to the host environment's current locale.
|
String |
toTimeString()
Returns a time as a string value.
|
String |
toUTCString()
Returns a date converted to a string using Universal Coordinated Time (UTC).
|
static double |
UTC(double year,
double month)
Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
|
static double |
UTC(double year,
double month,
double date)
Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
|
static double |
UTC(double year,
double month,
double date,
double hours)
Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
|
static double |
UTC(double year,
double month,
double date,
double hours,
double minutes)
Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
|
static double |
UTC(double year,
double month,
double date,
double hours,
double minutes,
double seconds)
Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
|
static double |
UTC(double year,
double month,
double date,
double hours,
double minutes,
double seconds,
double ms)
Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
|
Number |
valueOf()
Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.
|
$as, $cast, $delete, $get, $js, $set, create, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor, getOwnPropertyNames, getPrototypeOf, hasOwnProperty, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, newObject, newObject, preventExtensions, propertyIsEnumerable, seal, toString
public static Date prototype
protected Date(Objs.Constructor<?> c, Object js)
public Date()
public Date(double value)
public Date(double year, double month, double date, double hours, double minutes, double seconds, double ms)
public Date(double year, double month)
public Date(double year, double month, double date)
public Date(double year, double month, double date, double hours)
public Date(double year, double month, double date, double hours, double minutes)
public Date(double year, double month, double date, double hours, double minutes, double seconds)
public Date(String value)
public double getDate()
public double getDay()
public double getFullYear()
public double getHours()
public double getMilliseconds()
public double getMinutes()
public double getMonth()
public double getSeconds()
public double getTime()
public double getTimezoneOffset()
public double getUTCDate()
public double getUTCDay()
public double getUTCFullYear()
public double getUTCHours()
public double getUTCMilliseconds()
public double getUTCMinutes()
public double getUTCMonth()
public double getUTCSeconds()
public double setDate(double date)
date
- A numeric value equal to the day of the month.public double setFullYear(double year, double month, double date)
year
- A numeric value for the year.month
- A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.date
- A numeric value equal for the day of the month.public double setFullYear(double year)
year
- A numeric value for the year.month
- A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.date
- A numeric value equal for the day of the month.public double setFullYear(double year, double month)
year
- A numeric value for the year.month
- A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.date
- A numeric value equal for the day of the month.public double setHours(double hours, double min, double sec, double ms)
hours
- A numeric value equal to the hours value.min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setHours(double hours)
hours
- A numeric value equal to the hours value.min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setHours(double hours, double min)
hours
- A numeric value equal to the hours value.min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setHours(double hours, double min, double sec)
hours
- A numeric value equal to the hours value.min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setMilliseconds(double ms)
ms
- A numeric value equal to the millisecond value.public double setMinutes(double min, double sec, double ms)
min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setMinutes(double min)
min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setMinutes(double min, double sec)
min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setMonth(double month, double date)
month
- A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.date
- A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.public double setMonth(double month)
month
- A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.date
- A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.public double setSeconds(double sec, double ms)
sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setSeconds(double sec)
sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setTime(double time)
time
- A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.public double setUTCDate(double date)
date
- A numeric value equal to the day of the month.public double setUTCFullYear(double year, double month, double date)
year
- A numeric value equal to the year.month
- A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.date
- A numeric value equal to the day of the month.public double setUTCFullYear(double year)
year
- A numeric value equal to the year.month
- A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.date
- A numeric value equal to the day of the month.public double setUTCFullYear(double year, double month)
year
- A numeric value equal to the year.month
- A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.date
- A numeric value equal to the day of the month.public double setUTCHours(double hours, double min, double sec, double ms)
hours
- A numeric value equal to the hours value.min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setUTCHours(double hours)
hours
- A numeric value equal to the hours value.min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setUTCHours(double hours, double min)
hours
- A numeric value equal to the hours value.min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setUTCHours(double hours, double min, double sec)
hours
- A numeric value equal to the hours value.min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setUTCMilliseconds(double ms)
ms
- A numeric value equal to the millisecond value.public double setUTCMinutes(double min, double sec, double ms)
min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setUTCMinutes(double min)
min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setUTCMinutes(double min, double sec)
min
- A numeric value equal to the minutes value.sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setUTCMonth(double month, double date)
month
- A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.date
- A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.public double setUTCMonth(double month)
month
- A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.date
- A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.public double setUTCSeconds(double sec, double ms)
sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public double setUTCSeconds(double sec)
sec
- A numeric value equal to the seconds value.ms
- A numeric value equal to the milliseconds value.public String toDateString()
public String toISOString()
public String toJSON(Object key)
public String toJSON()
public String toLocaleDateString()
public String toLocaleString()
toLocaleString
in class Objs
public String toLocaleTimeString()
public String toTimeString()
public String toUTCString()
public Number valueOf()
public static double parse(String s)
s
- A date stringpublic static double UTC(double year, double month, double date, double hours, double minutes, double seconds, double ms)
year
- The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.month
- The month as an number between 0 and 11 (January to December).date
- The date as an number between 1 and 31.hours
- Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.minutes
- Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.seconds
- Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.ms
- An number from 0 to 999 that specifies the milliseconds.public static double UTC(double year, double month)
year
- The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.month
- The month as an number between 0 and 11 (January to December).date
- The date as an number between 1 and 31.hours
- Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.minutes
- Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.seconds
- Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.ms
- An number from 0 to 999 that specifies the milliseconds.public static double UTC(double year, double month, double date)
year
- The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.month
- The month as an number between 0 and 11 (January to December).date
- The date as an number between 1 and 31.hours
- Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.minutes
- Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.seconds
- Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.ms
- An number from 0 to 999 that specifies the milliseconds.public static double UTC(double year, double month, double date, double hours)
year
- The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.month
- The month as an number between 0 and 11 (January to December).date
- The date as an number between 1 and 31.hours
- Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.minutes
- Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.seconds
- Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.ms
- An number from 0 to 999 that specifies the milliseconds.public static double UTC(double year, double month, double date, double hours, double minutes)
year
- The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.month
- The month as an number between 0 and 11 (January to December).date
- The date as an number between 1 and 31.hours
- Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.minutes
- Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.seconds
- Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.ms
- An number from 0 to 999 that specifies the milliseconds.public static double UTC(double year, double month, double date, double hours, double minutes, double seconds)
year
- The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.month
- The month as an number between 0 and 11 (January to December).date
- The date as an number between 1 and 31.hours
- Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.minutes
- Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.seconds
- Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.ms
- An number from 0 to 999 that specifies the milliseconds.public static double now()
public static String newDate()
Copyright © 2018. All rights reserved.