public final class DateTime extends DateTime implements scala.math.Ordered<DateTime>, Renderable, scala.Product, java.io.Serializable
Constructor and Description |
---|
DateTime() |
Modifier and Type | Method and Description |
---|---|
static DateTime |
apply(int year,
int month,
int day,
int hour,
int minute,
int second)
Creates a new
DateTime with the given properties. |
static DateTime |
apply(long clicks)
Creates a new
DateTime from the number of milli seconds
since the start of "the epoch", namely January 1, 1970, 00:00:00 GMT. |
long |
clicks()
Returns this instant as "clicks", i.e. as milliseconds since January 1, 1970, 00:00:00 GMT
|
int |
compare(DateTime that) |
int |
day()
Returns the day of this instant in GMT.
|
boolean |
equals(java.lang.Object obj) |
static scala.Option<DateTime> |
fromIsoDateTimeString(java.lang.String string)
Creates a new DateTime instance from the given String,
if it adheres to the format
yyyy-mm-ddThh:mm:ss[.SSSZ] . |
int |
hashCode() |
int |
hour()
Returns the hour of this instant in GMT.
|
boolean |
isLeapYear()
Returns if this instant interpreted as a Date in GMT belongs to a leap year.
|
static DateTime |
MaxValue() |
DateTime |
minus(long millis)
Creates a new
DateTime that represents the point in time the given number of ms earlier. |
int |
minute()
Returns the minute of this instant in GMT.
|
static DateTime |
MinValue() |
int |
month()
Returns the month of this instant in GMT.
|
java.lang.String |
monthStr()
The month as a 3 letter abbreviation:
Jan , Feb , Mar , Apr , May , Jun , Jul , Aug , Sep , Oct , Nov or Dec |
static DateTime |
now()
Creates a new
DateTime instance for the current point in time. |
DateTime |
plus(long millis)
Creates a new
DateTime that represents the point in time the given number of ms later. |
<R extends Rendering> |
render(R r)
yyyy-mm-ddThh:mm:ss |
<R extends Rendering> |
renderIsoDate(R r)
yyyy-mm-dd |
<R extends Rendering> |
renderIsoDateTimeString(R r)
yyyy-mm-ddThh:mm:ss |
<R extends Rendering> |
renderIsoLikeDateTimeString(R r)
yyyy-mm-dd hh:mm:ss |
<R extends Rendering> |
renderRfc1123DateTimeString(R r)
RFC1123 date string, e.g.
|
int |
second()
Returns the second of this instant in GMT.
|
java.lang.String |
toIsoDateString()
yyyy-mm-dd |
java.lang.String |
toIsoDateTimeString()
yyyy-mm-ddThh:mm:ss |
java.lang.String |
toIsoLikeDateTimeString()
yyyy-mm-dd hh:mm:ss |
java.lang.String |
toRfc1123DateTimeString()
RFC1123 date string, e.g.
|
java.lang.String |
toString()
yyyy-mm-ddThh:mm:ss |
int |
weekday()
Returns the weekday of this instant in GMT.
|
java.lang.String |
weekdayStr()
The day of the week as a 3 letter abbreviation:
Sun , Mon , Tue , Wed , Thu , Fri or Sat |
int |
year()
Returns the year of this instant in GMT.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
$greater, $greater$eq, $init$, $less, $less$eq, compareTo, orderingToOrdered
public static DateTime MinValue()
public static DateTime MaxValue()
public static DateTime apply(int year, int month, int day, int hour, int minute, int second)
DateTime
with the given properties.
Note that this implementation discards milliseconds (i.e. rounds down to full seconds).year
- (undocumented)month
- (undocumented)day
- (undocumented)hour
- (undocumented)minute
- (undocumented)second
- (undocumented)public static DateTime apply(long clicks)
DateTime
from the number of milli seconds
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).clicks
- (undocumented)public static DateTime now()
DateTime
instance for the current point in time.
Note that this implementation discards milliseconds (i.e. rounds down to full seconds).public static scala.Option<DateTime> fromIsoDateTimeString(java.lang.String string)
yyyy-mm-ddThh:mm:ss[.SSSZ]
.
Note that this implementation discards milliseconds (i.e. rounds down to full seconds).string
- (undocumented)public int year()
DateTime
public int month()
DateTime
public int day()
DateTime
public int hour()
DateTime
public int minute()
DateTime
public int second()
DateTime
public int weekday()
DateTime
public long clicks()
DateTime
public boolean isLeapYear()
DateTime
isLeapYear
in class DateTime
public java.lang.String weekdayStr()
Sun
, Mon
, Tue
, Wed
, Thu
, Fri
or Sat
weekdayStr
in class DateTime
public java.lang.String monthStr()
Jan
, Feb
, Mar
, Apr
, May
, Jun
, Jul
, Aug
, Sep
, Oct
, Nov
or Dec
public DateTime minus(long millis)
DateTime
that represents the point in time the given number of ms earlier.public DateTime plus(long millis)
DateTime
that represents the point in time the given number of ms later.public <R extends Rendering> Rendering render(R r)
yyyy-mm-ddThh:mm:ss
render
in interface Renderable
r
- (undocumented)public java.lang.String toString()
yyyy-mm-ddThh:mm:ss
toString
in class java.lang.Object
public <R extends Rendering> Rendering renderIsoDate(R r)
yyyy-mm-dd
r
- (undocumented)public java.lang.String toIsoDateString()
yyyy-mm-dd
toIsoDateString
in class DateTime
public <R extends Rendering> Rendering renderIsoDateTimeString(R r)
yyyy-mm-ddThh:mm:ss
r
- (undocumented)public java.lang.String toIsoDateTimeString()
yyyy-mm-ddThh:mm:ss
toIsoDateTimeString
in class DateTime
public <R extends Rendering> Rendering renderIsoLikeDateTimeString(R r)
yyyy-mm-dd hh:mm:ss
r
- (undocumented)public java.lang.String toIsoLikeDateTimeString()
yyyy-mm-dd hh:mm:ss
toIsoLikeDateTimeString
in class DateTime
public <R extends Rendering> Rendering renderRfc1123DateTimeString(R r)
Sun, 06 Nov 1994 08:49:37 GMT
r
- (undocumented)public java.lang.String toRfc1123DateTimeString()
Sun, 06 Nov 1994 08:49:37 GMT
toRfc1123DateTimeString
in class DateTime
public int compare(DateTime that)
compare
in interface scala.math.Ordered<DateTime>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface scala.Equals
equals
in class java.lang.Object