public abstract class DateTime
extends java.lang.Object
Constructor and Description |
---|
DateTime() |
Modifier and Type | Method and Description |
---|---|
abstract long |
clicks()
Returns this instant as "clicks", i.e. as milliseconds since January 1, 1970, 00:00:00 GMT
|
static DateTime |
create(int year,
int month,
int day,
int hour,
int minute,
int second)
Returns a new DateTime instance by interpreting the given date/time components as an instant in
GMT.
|
static DateTime |
create(long clicks)
Returns a new DateTime instance representing the instant as defined by "clicks" i.e. from the
number of milliseconds since the start of "the epoch", namely January 1, 1970, 00:00:00 GMT.
|
abstract int |
day()
Returns the day of this instant in GMT.
|
static java.util.Optional<DateTime> |
fromIsoDateTimeString(java.lang.String isoDateTimeString)
Returns a new DateTime instance parsed from IsoDateTimeString as Some(dateTime).
|
abstract int |
hour()
Returns the hour of this instant in GMT.
|
abstract boolean |
isLeapYear()
Returns if this instant interpreted as a Date in GMT belongs to a leap year.
|
abstract DateTime |
minus(long millis)
Creates a new `DateTime` that represents the point in time the given number of ms earlier.
|
abstract int |
minute()
Returns the minute of this instant in GMT.
|
abstract int |
month()
Returns the month of this instant in GMT.
|
abstract java.lang.String |
monthStr()
Returns the month as a 3 letter abbreviation: `Jan`, `Feb`, `Mar`, `Apr`, `May`, `Jun`, `Jul`,
`Aug`, `Sep`, `Oct`, `Nov` or `Dec`
|
static DateTime |
now()
Returns a new DateTime instance representing the current instant.
|
abstract DateTime |
plus(long millis)
Creates a new `DateTime` that represents the point in time the given number of ms later.
|
abstract int |
second()
Returns the second of this instant in GMT.
|
abstract java.lang.String |
toIsoDateString()
Returns a String representation like this: `yyyy-mm-dd`
|
abstract java.lang.String |
toIsoDateTimeString()
Returns a String representation like this: `yyyy-mm-ddThh:mm:ss`
|
abstract java.lang.String |
toIsoLikeDateTimeString()
Returns a String representation like this: `yyyy-mm-dd hh:mm:ss`
|
abstract java.lang.String |
toRfc1123DateTimeString()
Returns an RFC1123 date string, e.g.
|
abstract int |
weekday()
Returns the weekday of this instant in GMT.
|
abstract java.lang.String |
weekdayStr()
Returns the day of the week as a 3 letter abbreviation: `Sun`, `Mon`, `Tue`, `Wed`, `Thu`,
`Fri` or `Sat`
|
abstract int |
year()
Returns the year of this instant in GMT.
|
public abstract int year()
public abstract int month()
public abstract int day()
public abstract int hour()
public abstract int minute()
public abstract int second()
public abstract int weekday()
public abstract long clicks()
public abstract boolean isLeapYear()
public abstract java.lang.String weekdayStr()
public abstract java.lang.String monthStr()
public abstract java.lang.String toIsoDateString()
public abstract java.lang.String toIsoDateTimeString()
public abstract java.lang.String toIsoLikeDateTimeString()
public abstract java.lang.String toRfc1123DateTimeString()
public static DateTime now()
public abstract DateTime minus(long millis)
public abstract DateTime plus(long millis)
public static java.util.Optional<DateTime> fromIsoDateTimeString(java.lang.String isoDateTimeString)
public static DateTime create(long clicks)
public static DateTime create(int year, int month, int day, int hour, int minute, int second)