Interface MqlDate

All Superinterfaces:
MqlValue

@Sealed @Beta(CLIENT) public interface MqlDate extends 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 Details

    • year

      MqlInteger year(MqlString timezone)
      The year of this date as determined by the provided timezone.
      Parameters:
      timezone - the UTC Offset or Olson Timezone Identifier.
      Returns:
      the resulting value.
    • month

      MqlInteger month(MqlString timezone)
      The month of this date as determined by the provided timezone, as an integer between 1 and 12.
      Parameters:
      timezone - the UTC Offset or Olson Timezone Identifier.
      Returns:
      the resulting value.
    • dayOfMonth

      MqlInteger dayOfMonth(MqlString timezone)
      The day of the month of this date as determined by the provided timezone, as an integer between 1 and 31.
      Parameters:
      timezone - the UTC Offset or Olson Timezone Identifier.
      Returns:
      the resulting value.
    • dayOfWeek

      MqlInteger dayOfWeek(MqlString timezone)
      The day of the week of this date as determined by the provided timezone, as an integer between 1 (Sunday) and 7 (Saturday).
      Parameters:
      timezone - the UTC Offset or Olson Timezone Identifier.
      Returns:
      the resulting value.
    • dayOfYear

      MqlInteger dayOfYear(MqlString timezone)
      The day of the year of this date as determined by the provided timezone, as an integer between 1 and 366.
      Parameters:
      timezone - the UTC Offset or Olson Timezone Identifier.
      Returns:
      the resulting value.
    • hour

      MqlInteger hour(MqlString timezone)
      The hour of this date as determined by the provided timezone, as an integer between 0 and 23.
      Parameters:
      timezone - the UTC Offset or Olson Timezone Identifier.
      Returns:
      the resulting value.
    • minute

      MqlInteger minute(MqlString timezone)
      The minute of this date as determined by the provided timezone, as an integer between 0 and 59.
      Parameters:
      timezone - the UTC Offset or Olson Timezone Identifier.
      Returns:
      the resulting value.
    • second

      MqlInteger second(MqlString timezone)
      The second of this date as determined by the provided timezone, 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

      MqlInteger week(MqlString timezone)
      The week of the year of this date as determined by the provided timezone, 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

      MqlInteger millisecond(MqlString timezone)
      The millisecond part of this date as determined by the provided timezone, as an integer between 0 and 999.
      Parameters:
      timezone - the UTC Offset or Olson Timezone Identifier.
      Returns:
      the resulting value.
    • asString

      MqlString asString(MqlString timezone, MqlString format)
      The string representation of this date as determined by the provided timezone, and formatted according to the format.
      Parameters:
      timezone - the UTC Offset or Olson Timezone Identifier.
      format - the format specifier.
      Returns:
      the resulting value.
    • passDateTo

      <R extends MqlValue> R passDateTo(Function<? super MqlDate,? extends R> f)
      The result of passing this value to the provided function. Equivalent to f.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 to this value.
      Type Parameters:
      R - the type of the resulting value.
      Parameters:
      mapping - the switch mapping.
      Returns:
      the resulting value.
      See Also: