@InterfaceStability.Experimental @InterfaceAudience.Public public class DateFunctions extends Object
DSL for N1QL functions in the Date category.
Date functions return the system clock value or manipulate the date string.
Modifier and Type | Class and Description |
---|---|
static class |
DateFunctions.DatePart |
static class |
DateFunctions.DatePartExt |
Constructor and Description |
---|
DateFunctions() |
Modifier and Type | Method and Description |
---|---|
static Expression |
clockMillis()
Returned expression results in system clock at function evaluation time, as UNIX milliseconds.
|
static Expression |
clockStr(String format)
Returned expression results in system clock at function evaluation time, as a string in a supported format.
|
static Expression |
dateAddMillis(Expression expression,
int n,
DateFunctions.DatePart part)
Returned expression performs Date arithmetic, and returns result of computation.
|
static Expression |
dateAddMillis(String expression,
int n,
DateFunctions.DatePart part)
Returned expression performs Date arithmetic, and returns result of computation.
|
static Expression |
dateAddStr(Expression expression,
int n,
DateFunctions.DatePart part)
Returned expression results in Performs Date arithmetic.
|
static Expression |
dateAddStr(String expression,
int n,
DateFunctions.DatePart part)
Returned expression results in Performs Date arithmetic.
|
static Expression |
dateDiffMillis(Expression expression1,
Expression expression2,
DateFunctions.DatePart part)
Returned expression results in Date arithmetic.
|
static Expression |
dateDiffMillis(String expression1,
String expression2,
DateFunctions.DatePart part)
Returned expression results in Date arithmetic.
|
static Expression |
dateDiffStr(Expression expression1,
Expression expression2,
DateFunctions.DatePart part)
Returned expression results in Performs Date arithmetic.
|
static Expression |
dateDiffStr(String expression1,
String expression2,
DateFunctions.DatePart part)
Returned expression results in Performs Date arithmetic.
|
static Expression |
datePartMillis(Expression expression,
DateFunctions.DatePartExt part)
Returned expression results in Date part as an integer.
|
static Expression |
datePartMillis(String expression,
DateFunctions.DatePartExt part)
Returned expression results in Date part as an integer.
|
static Expression |
datePartStr(Expression expression,
DateFunctions.DatePartExt part)
Returned expression results in Date part as an integer.
|
static Expression |
datePartStr(String expression,
DateFunctions.DatePartExt part)
Returned expression results in Date part as an integer.
|
static Expression |
dateTruncMillis(Expression expression,
DateFunctions.DatePart part)
Returned expression results in UNIX timestamp that has been truncated so that the given date part is the least significant.
|
static Expression |
dateTruncMillis(String expression,
DateFunctions.DatePart part)
Returned expression results in UNIX timestamp that has been truncated so that the given date part is the least significant.
|
static Expression |
dateTruncStr(Expression expression,
DateFunctions.DatePart part)
Returned expression results in ISO 8601 timestamp that has been truncated so that the given date part is the least significant.
|
static Expression |
dateTruncStr(String expression,
DateFunctions.DatePart part)
Returned expression results in ISO 8601 timestamp that has been truncated so that the given date part is the least significant.
|
static Expression |
millis(Expression expression)
Returned expression results in date that has been converted in a supported format to UNIX milliseconds.
|
static Expression |
millis(String expression)
Returned expression results in date that has been converted in a supported format to UNIX milliseconds.
|
static Expression |
millisToStr(Expression expression,
String format)
Returned expression results in the string in the supported format to which the UNIX milliseconds has been converted.
|
static Expression |
millisToStr(String expression,
String format)
Returned expression results in the string in the supported format to which the UNIX milliseconds has been converted.
|
static Expression |
millisToUtc(Expression expression,
String format)
Returned expression results in the UTC string to which the UNIX time stamp has been converted in the supported format.
|
static Expression |
millisToUtc(String expression,
String format)
Returned expression results in the UTC string to which the UNIX time stamp has been converted in the supported format.
|
static Expression |
millisToZone(Expression expression,
String timeZoneName,
String format)
Returned expression results in a convertion of the UNIX time stamp to a string in the named time zone.
|
static Expression |
millisToZone(String expression,
String timeZoneName,
String format)
Returned expression results in a convertion of the UNIX time stamp to a string in the named time zone.
|
static Expression |
nowMillis()
Returned expression results in statement time stamp as UNIX milliseconds; does not vary during a query.
|
static Expression |
nowStr(String format)
Returned expression results in statement time stamp as a string in a supported format; does not vary during a query.
|
static Expression |
strToMillis(Expression expression)
Returned expression results in date that has been converted in a supported format to UNIX milliseconds.
|
static Expression |
strToMillis(String expression)
Returned expression results in date that has been converted in a supported format to UNIX milliseconds.
|
static Expression |
strToUtc(Expression expression)
Returned expression results in a conversion of the ISO 8601 time stamp to UTC.
|
static Expression |
strToUtc(String expression)
Returned expression results in a conversion of the ISO 8601 time stamp to UTC.
|
static Expression |
strToZoneName(Expression expression,
String zoneName)
Returned expression results in a conversion of the supported time stamp string to the named time zone.
|
static Expression |
strToZoneName(String expression,
String zoneName)
Returned expression results in a conversion of the supported time stamp string to the named time zone.
|
public static Expression clockMillis()
Returned expression results in system clock at function evaluation time, as UNIX milliseconds. Varies during a query.
public static Expression clockStr(String format)
Returned expression results in system clock at function evaluation time, as a string in a supported format. Varies during a query. Supported formats:
public static Expression dateAddMillis(Expression expression, int n, DateFunctions.DatePart part)
Returned expression performs Date arithmetic, and returns result of computation. n and part are used to define an interval or duration, which is then added (or subtracted) to the UNIX timestamp, returning the result.
public static Expression dateAddMillis(String expression, int n, DateFunctions.DatePart part)
Returned expression performs Date arithmetic, and returns result of computation. n and part are used to define an interval or duration, which is then added (or subtracted) to the UNIX timestamp, returning the result.
public static Expression dateAddStr(Expression expression, int n, DateFunctions.DatePart part)
Returned expression results in Performs Date arithmetic. n and part are used to define an interval or duration, which is then added (or subtracted) to the date string in a supported format, returning the result.
public static Expression dateAddStr(String expression, int n, DateFunctions.DatePart part)
Returned expression results in Performs Date arithmetic. n and part are used to define an interval or duration, which is then added (or subtracted) to the date string in a supported format, returning the result.
public static Expression dateDiffMillis(Expression expression1, Expression expression2, DateFunctions.DatePart part)
Returned expression results in Date arithmetic. Returns the elapsed time between two UNIX timestamps as an integer whose unit is part.
public static Expression dateDiffMillis(String expression1, String expression2, DateFunctions.DatePart part)
Returned expression results in Date arithmetic. Returns the elapsed time between two UNIX timestamps as an integer whose unit is part.
public static Expression dateDiffStr(Expression expression1, Expression expression2, DateFunctions.DatePart part)
Returned expression results in Performs Date arithmetic. Returns the elapsed time between two date strings in a supported format, as an integer whose unit is part.
public static Expression dateDiffStr(String expression1, String expression2, DateFunctions.DatePart part)
Returned expression results in Performs Date arithmetic. Returns the elapsed time between two date strings in a supported format, as an integer whose unit is part.
public static Expression datePartMillis(Expression expression, DateFunctions.DatePartExt part)
Returned expression results in Date part as an integer. The date expression is a number representing UNIX milliseconds, and part is a DateFunctions.DatePartExt
.
public static Expression datePartMillis(String expression, DateFunctions.DatePartExt part)
Returned expression results in Date part as an integer. The date expression is a number representing UNIX milliseconds, and part is a DateFunctions.DatePartExt
.
public static Expression datePartStr(Expression expression, DateFunctions.DatePartExt part)
Returned expression results in Date part as an integer. The date expression is a string in a supported format, and part is one of the supported date part strings.
public static Expression datePartStr(String expression, DateFunctions.DatePartExt part)
Returned expression results in Date part as an integer. The date expression is a string in a supported format, and part is one of the supported date part strings.
public static Expression dateTruncMillis(Expression expression, DateFunctions.DatePart part)
Returned expression results in UNIX timestamp that has been truncated so that the given date part is the least significant.
public static Expression dateTruncMillis(String expression, DateFunctions.DatePart part)
Returned expression results in UNIX timestamp that has been truncated so that the given date part is the least significant.
public static Expression dateTruncStr(Expression expression, DateFunctions.DatePart part)
Returned expression results in ISO 8601 timestamp that has been truncated so that the given date part is the least significant.
public static Expression dateTruncStr(String expression, DateFunctions.DatePart part)
Returned expression results in ISO 8601 timestamp that has been truncated so that the given date part is the least significant.
public static Expression millis(Expression expression)
Returned expression results in date that has been converted in a supported format to UNIX milliseconds.
public static Expression millis(String expression)
Returned expression results in date that has been converted in a supported format to UNIX milliseconds.
public static Expression strToMillis(Expression expression)
Returned expression results in date that has been converted in a supported format to UNIX milliseconds.
public static Expression strToMillis(String expression)
Returned expression results in date that has been converted in a supported format to UNIX milliseconds.
public static Expression millisToStr(Expression expression, String format)
Returned expression results in the string in the supported format to which the UNIX milliseconds has been converted.
public static Expression millisToStr(String expression, String format)
Returned expression results in the string in the supported format to which the UNIX milliseconds has been converted.
public static Expression millisToUtc(Expression expression, String format)
Returned expression results in the UTC string to which the UNIX time stamp has been converted in the supported format.
public static Expression millisToUtc(String expression, String format)
Returned expression results in the UTC string to which the UNIX time stamp has been converted in the supported format.
public static Expression millisToZone(Expression expression, String timeZoneName, String format)
Returned expression results in a convertion of the UNIX time stamp to a string in the named time zone.
public static Expression millisToZone(String expression, String timeZoneName, String format)
Returned expression results in a convertion of the UNIX time stamp to a string in the named time zone.
public static Expression nowMillis()
Returned expression results in statement time stamp as UNIX milliseconds; does not vary during a query.
public static Expression nowStr(String format)
Returned expression results in statement time stamp as a string in a supported format; does not vary during a query.
public static Expression strToUtc(Expression expression)
Returned expression results in a conversion of the ISO 8601 time stamp to UTC.
public static Expression strToUtc(String expression)
Returned expression results in a conversion of the ISO 8601 time stamp to UTC.
public static Expression strToZoneName(Expression expression, String zoneName)
Returned expression results in a conversion of the supported time stamp string to the named time zone.
public static Expression strToZoneName(String expression, String zoneName)
Returned expression results in a conversion of the supported time stamp string to the named time zone.
Copyright © 2014 Couchbase, Inc.