DateTimeExpressions extension

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

on

Properties

date Expression<String>
Formats this datetime in the format year-month-day.
no setter
datetime Expression<String>
Formats this datetime in the format year-month-day hour:minute:second.
no setter
day Expression<int>
Extracts the day from this datetime expression.
no setter
hour Expression<int>
Extracts the hour from this datetime expression.
no setter
julianday Expression<double>
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>
Extracts the minute from this datetime expression.
no setter
month Expression<int>
Extracts the month from this datetime expression.
no setter
second Expression<int>
Extracts the second from this datetime expression.
no setter
secondsSinceEpoch Expression<int>
Returns an expression containing the amount of seconds from the unix epoch (January 1st, 1970) to this datetime expression.
no setter
time Expression<String>
Formats this datetime in the format hour:minute:second.
no setter
unixepoch Expression<int>
Formats this datetime as a unix timestamp - the number of seconds since 1970-01-01 00:00:00 UTC.
no setter
year Expression<int>
Extracts the year from this datetime expression.
no setter

Methods

modify(DateTimeModifier modifier) Expression<DateTime>
Apply a modifier that alters the date and/or time.
modifyAll(Iterable<DateTimeModifier> modifiers) Expression<DateTime>
Applies modifiers that alters the date and/or time.
strftime(String format) Expression<String>
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>
Adds a duration to this date.
operator -(Duration duration) Expression<DateTime>
Subtracts duration from this date.

Static Methods

fromUnixEpoch(Expression<int> unixEpoch) Expression<DateTime>
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.