Class DateToParts


  • public class DateToParts
    extends Expression
    Returns a document that contains the constituent parts of a given BSON Date value as individual properties. The properties returned are year, month, day, hour, minute, second and millisecond.
    • Constructor Detail

      • DateToParts

        @MorphiaInternal
        public DateToParts​(Expression date)
        Parameters:
        date -
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Method Detail

      • iso8601

        public DateToParts iso8601​(boolean iso8601)
        Optional. If set to true, modifies the output document to use ISO week date fields. Defaults to false.
        Parameters:
        iso8601 - true to use ISO 8601
        Returns:
        this
      • timezone

        public DateToParts timezone​(Expression timezone)
        The optional timezone to use to format the date. By default, it uses UTC.
        Parameters:
        timezone - the expression
        Returns:
        this