DateTimeExpressions extension

Provides expressions to extract information from date time values, or to calculate the difference between datetimes.

on

Properties

date Expression<String>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Formats this datetime in the format year-month-day.
no setter
datetime Expression<String>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Formats this datetime in the format year-month-day hour:minute:second.
no setter
day Expression<int>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Extracts the day from this datetime expression.
no setter
hour Expression<int>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Extracts the hour from this datetime expression.
no setter
julianday Expression<double>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Formats this datetime in the Julian day format - a fractional number of days since noon in Greenwich on November 24, 4714 B.C.
no setter
minute Expression<int>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Extracts the minute from this datetime expression.
no setter
month Expression<int>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Extracts the month from this datetime expression.
no setter
second Expression<int>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Extracts the second from this datetime expression.
no setter
secondsSinceEpoch Expression<int>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Returns an expression containing the amount of seconds from the unix epoch (January 1st, 1970) to this datetime expression.
no setter
time Expression<String>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Formats this datetime in the format hour:minute:second.
no setter
unixepoch Expression<int>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Formats this datetime as a unix timestamp - the number of seconds since 1970-01-01 00:00:00 UTC.
no setter
year Expression<int>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Extracts the year from this datetime expression.
no setter

Methods

modify(DateTimeModifier modifier) Expression<DateTime>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Apply a modifier that alters the date and/or time.
modifyAll(Iterable<DateTimeModifier> modifiers) Expression<DateTime>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Applies modifiers that alters the date and/or time.
strftime(String format) Expression<String>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Formats this datetime according to the format string specified as the first argument. The format string supports the most common substitutions found in the strftime() function from the standard C library plus two new substitutions, %f and %J. The following is a complete list of valid strftime() substitutions:

Operators

operator +(Duration duration) Expression<DateTime>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Adds a duration to this date.
operator -(Duration duration) Expression<DateTime>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Subtracts duration from this date.

Static Methods

fromUnixEpoch(Expression<int> unixEpoch) Expression<DateTime>

Available on Expression<DateTime>, provided by the DateTimeExpressions extension

Converts a numeric expression unixEpoch into a date time by interpreting it as the amount of seconds since 1970-01-01 00:00:00 UTC.