Class DateTime
java.lang.Object
org.apache.pekko.http.javadsl.model.DateTime
- Direct Known Subclasses:
- DateTime
Immutable, fast and efficient Date + Time implementation without any dependencies. Does not
 support TimeZones, all DateTime values are always GMT based. Note that this implementation
 discards milliseconds (i.e. rounds down to full seconds).
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract longclicks()Returns this instant as "clicks", i.e. as milliseconds since January 1, 1970, 00:00:00 GMTstatic DateTimecreate(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 DateTimecreate(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 intday()Returns the day of this instant in GMT.fromIsoDateTimeString(String isoDateTimeString) Returns a new DateTime instance parsed from IsoDateTimeString as Some(dateTime).abstract inthour()Returns the hour of this instant in GMT.abstract booleanReturns if this instant interpreted as a Date in GMT belongs to a leap year.abstract DateTimeminus(long millis) Creates a new `DateTime` that represents the point in time the given number of ms earlier.abstract intminute()Returns the minute of this instant in GMT.abstract intmonth()Returns the month of this instant in GMT.abstract StringmonthStr()Returns the month as a 3 letter abbreviation: `Jan`, `Feb`, `Mar`, `Apr`, `May`, `Jun`, `Jul`, `Aug`, `Sep`, `Oct`, `Nov` or `Dec`static DateTimenow()Returns a new DateTime instance representing the current instant.abstract DateTimeplus(long millis) Creates a new `DateTime` that represents the point in time the given number of ms later.abstract intsecond()Returns the second of this instant in GMT.abstract StringReturns a String representation like this: `yyyy-mm-dd`abstract StringReturns a String representation like this: `yyyy-mm-ddThh:mm:ss`abstract StringReturns a String representation like this: `yyyy-mm-dd hh:mm:ss`abstract StringReturns an RFC1123 date string, e.g.abstract intweekday()Returns the weekday of this instant in GMT.abstract StringReturns the day of the week as a 3 letter abbreviation: `Sun`, `Mon`, `Tue`, `Wed`, `Thu`, `Fri` or `Sat`abstract intyear()Returns the year of this instant in GMT.
- 
Constructor Details- 
DateTimepublic DateTime()
 
- 
- 
Method Details- 
yearpublic abstract int year()Returns the year of this instant in GMT.
- 
monthpublic abstract int month()Returns the month of this instant in GMT.
- 
daypublic abstract int day()Returns the day of this instant in GMT.
- 
hourpublic abstract int hour()Returns the hour of this instant in GMT.
- 
minutepublic abstract int minute()Returns the minute of this instant in GMT.
- 
secondpublic abstract int second()Returns the second of this instant in GMT.
- 
weekdaypublic abstract int weekday()Returns the weekday of this instant in GMT. Sunday is 0, Monday is 1, etc.
- 
clickspublic abstract long clicks()Returns this instant as "clicks", i.e. as milliseconds since January 1, 1970, 00:00:00 GMT
- 
isLeapYearpublic abstract boolean isLeapYear()Returns if this instant interpreted as a Date in GMT belongs to a leap year.
- 
weekdayStrReturns the day of the week as a 3 letter abbreviation: `Sun`, `Mon`, `Tue`, `Wed`, `Thu`, `Fri` or `Sat`
- 
monthStrReturns the month as a 3 letter abbreviation: `Jan`, `Feb`, `Mar`, `Apr`, `May`, `Jun`, `Jul`, `Aug`, `Sep`, `Oct`, `Nov` or `Dec`
- 
toIsoDateStringReturns a String representation like this: `yyyy-mm-dd`
- 
toIsoDateTimeStringReturns a String representation like this: `yyyy-mm-ddThh:mm:ss`
- 
toIsoLikeDateTimeStringReturns a String representation like this: `yyyy-mm-dd hh:mm:ss`
- 
toRfc1123DateTimeStringReturns an RFC1123 date string, e.g. `Sun, 06 Nov 1994 08:49:37 GMT`
- 
nowReturns a new DateTime instance representing the current instant.
- 
minusCreates a new `DateTime` that represents the point in time the given number of ms earlier.
- 
plusCreates a new `DateTime` that represents the point in time the given number of ms later.
- 
fromIsoDateTimeStringReturns a new DateTime instance parsed from IsoDateTimeString as Some(dateTime). Returns None if parsing has failed.
- 
createReturns 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. Note that this implementation discards milliseconds (i.e. rounds down to full seconds).
- 
createReturns a new DateTime instance by interpreting the given date/time components as an instant in GMT.
 
-