@JsType(isNative=true, namespace="<global>", name="Date") public class JsDate extends Object
Constructor and Description |
---|
JsDate()
Creates a JavaScript Date object for the current date and time according to system settings.
|
JsDate(Integer year,
Integer month)
Creates a JavaScript Date object
|
JsDate(Integer year,
Integer month,
Integer day)
Creates a JavaScript Date object
|
JsDate(Integer year,
Integer month,
Integer day,
Integer hour)
Creates a JavaScript Date object
|
JsDate(Integer year,
Integer month,
Integer day,
Integer hour,
Integer minute)
Creates a JavaScript Date object
|
JsDate(Integer year,
Integer month,
Integer day,
Integer hour,
Integer minute,
Integer second)
Creates a JavaScript Date object
|
JsDate(Integer year,
Integer month,
Integer day,
Integer hour,
Integer minute,
Integer second,
Integer millisecond)
Creates a JavaScript Date object
|
JsDate(Number value) |
JsDate(String dateString) |
Modifier and Type | Method and Description |
---|---|
static JsDate |
now()
Returns the numeric value corresponding to the current time - the number of milliseconds elapsed since 1
January 1970 00:00:00 UTC, with leap seconds ignored.
|
static JsDate |
parse(String dateString)
Parses a string representation of a date and returns the number of milliseconds since 1 January,
1970, 00:00:00, UTC, with leap seconds ignored.
|
String |
toString() |
@JsConstructor public JsDate()
@JsConstructor public JsDate(Number value)
@JsConstructor public JsDate(String dateString)
@JsConstructor public JsDate(Integer year, Integer month)
year
- Integer value representing the year. Values from 0 to 99 map to the years 1900 to 1999.month
- Integer value representing the month, beginning with 0 for January to 11 for December.@JsConstructor public JsDate(Integer year, Integer month, Integer day)
year
- Integer value representing the year. Values from 0 to 99 map to the years 1900 to 1999.month
- Integer value representing the month, beginning with 0 for January to 11 for December.day
- Integer value representing the day of the month.@JsConstructor public JsDate(Integer year, Integer month, Integer day, Integer hour)
year
- Integer value representing the year. Values from 0 to 99 map to the years 1900 to 1999.month
- Integer value representing the month, beginning with 0 for January to 11 for December.day
- Integer value representing the day of the month.hour
- Integer value representing the hour of the day.@JsConstructor public JsDate(Integer year, Integer month, Integer day, Integer hour, Integer minute)
year
- Integer value representing the year. Values from 0 to 99 map to the years 1900 to 1999.month
- Integer value representing the month, beginning with 0 for January to 11 for December.day
- Integer value representing the day of the month.hour
- Integer value representing the hour of the day.minute
- Integer value representing the minute segment of a time.@JsConstructor public JsDate(Integer year, Integer month, Integer day, Integer hour, Integer minute, Integer second)
year
- Integer value representing the year. Values from 0 to 99 map to the years 1900 to 1999.month
- Integer value representing the month, beginning with 0 for January to 11 for December.day
- Integer value representing the day of the month.hour
- Integer value representing the hour of the day.minute
- Integer value representing the minute segment of a time.second
- Integer value representing the second segment of a time.@JsConstructor public JsDate(Integer year, Integer month, Integer day, Integer hour, Integer minute, Integer second, Integer millisecond)
year
- Integer value representing the year. Values from 0 to 99 map to the years 1900 to 1999.month
- Integer value representing the month, beginning with 0 for January to 11 for December.day
- Integer value representing the day of the month.hour
- Integer value representing the hour of the day.minute
- Integer value representing the minute segment of a time.second
- Integer value representing the second segment of a time.millisecond
- Integer value representing the millisecond segment of a time.@JsMethod public static JsDate now()
@JsMethod public static JsDate parse(String dateString)
dateString
- A string representing an RFC2822 or ISO 8601 date (other formats may be used, but results may be unexpected).Copyright © 2019. All rights reserved.