Package com.mongodb.client.model.mql
Interface MqlDate
- All Superinterfaces:
MqlValue
A UTC date-time value in the context
of the MongoDB Query Language (MQL). Tracks the number of
milliseconds since the Unix epoch, and does not track the timezone.
- Since:
- 4.9.0
- MongoDB documentation
- Format Specifiers, UTC Offset, and Olson Timezone Identifier
-
Method Summary
Modifier and TypeMethodDescriptionThe string representation ofthis
date as determined by the providedtimezone
, and formatted according to theformat
.dayOfMonth
(MqlString timezone) The day of the month ofthis
date as determined by the providedtimezone
, as an integer between 1 and 31.The day of the week ofthis
date as determined by the providedtimezone
, as an integer between 1 (Sunday) and 7 (Saturday).The day of the year ofthis
date as determined by the providedtimezone
, as an integer between 1 and 366.The hour ofthis
date as determined by the providedtimezone
, as an integer between 0 and 23.millisecond
(MqlString timezone) The millisecond part ofthis
date as determined by the providedtimezone
, as an integer between 0 and 999.The minute ofthis
date as determined by the providedtimezone
, as an integer between 0 and 59.The month ofthis
date as determined by the providedtimezone
, as an integer between 1 and 12.<R extends MqlValue>
RpassDateTo
(Function<? super MqlDate, ? extends R> f) The result of passingthis
value to the provided function.The second ofthis
date as determined by the providedtimezone
, as an integer between 0 and 59, and 60 in the case of a leap second.<R extends MqlValue>
RswitchDateOn
(Function<Branches<MqlDate>, ? extends BranchesTerminal<MqlDate, ? extends R>> mapping) The result of applying the provided switch mapping tothis
value.The week of the year ofthis
date as determined by the providedtimezone
, as an integer between 0 and 53.The year ofthis
date as determined by the providedtimezone
.Methods inherited from interface com.mongodb.client.model.mql.MqlValue
asString, eq, equals, gt, gte, isArrayOr, isBooleanOr, isDateOr, isDocumentOr, isIntegerOr, isMapOr, isNumberOr, isStringOr, lt, lte, ne, passTo, switchOn
-
Method Details
-
year
The year ofthis
date as determined by the providedtimezone
.- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.- Returns:
- the resulting value.
-
month
The month ofthis
date as determined by the providedtimezone
, as an integer between 1 and 12.- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.- Returns:
- the resulting value.
-
dayOfMonth
The day of the month ofthis
date as determined by the providedtimezone
, as an integer between 1 and 31.- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.- Returns:
- the resulting value.
-
dayOfWeek
The day of the week ofthis
date as determined by the providedtimezone
, as an integer between 1 (Sunday) and 7 (Saturday).- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.- Returns:
- the resulting value.
-
dayOfYear
The day of the year ofthis
date as determined by the providedtimezone
, as an integer between 1 and 366.- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.- Returns:
- the resulting value.
-
hour
The hour ofthis
date as determined by the providedtimezone
, as an integer between 0 and 23.- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.- Returns:
- the resulting value.
-
minute
The minute ofthis
date as determined by the providedtimezone
, as an integer between 0 and 59.- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.- Returns:
- the resulting value.
-
second
The second ofthis
date as determined by the providedtimezone
, as an integer between 0 and 59, and 60 in the case of a leap second.- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.- Returns:
- the resulting value.
-
week
The week of the year ofthis
date as determined by the providedtimezone
, as an integer between 0 and 53.Weeks begin on Sundays, and week 1 begins with the first Sunday of the year. Days preceding the first Sunday of the year are in week 0.
- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.- Returns:
- the resulting value.
-
millisecond
The millisecond part ofthis
date as determined by the providedtimezone
, as an integer between 0 and 999.- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.- Returns:
- the resulting value.
-
asString
The string representation ofthis
date as determined by the providedtimezone
, and formatted according to theformat
.- Parameters:
timezone
- the UTC Offset or Olson Timezone Identifier.format
- the format specifier.- Returns:
- the resulting value.
-
passDateTo
The result of passingthis
value to the provided function. Equivalent tof.apply(this)
, and allows lambdas and static, user-defined functions to use the chaining syntax.- Type Parameters:
R
- the type of the resulting value.- Parameters:
f
- the function to apply.- Returns:
- the resulting value.
- See Also:
-
switchDateOn
<R extends MqlValue> R switchDateOn(Function<Branches<MqlDate>, ? extends BranchesTerminal<MqlDate, ? extends R>> mapping) The result of applying the provided switch mapping tothis
value.- Type Parameters:
R
- the type of the resulting value.- Parameters:
mapping
- the switch mapping.- Returns:
- the resulting value.
- See Also:
-