Class DateTime

    • Constructor Detail

      • DateTime

        public DateTime​(Date aDate)
        Deprecated.
        Constructs a new datetime from the specified Java date and with the host time zone as time zone.
        Parameters:
        aDate - the Java date from which a datetime is built.
      • DateTime

        public DateTime​(Date aDate,
                        TimeZone timeZone)
        Deprecated.
        Constructs a new datetime from the specified Java date and in the specified time zone.
        Parameters:
        aDate - the Java date from which a datetime is built.
        timeZone - the time zone in which this date is set.
    • Method Detail

      • now

        public static DateTime now()
        Deprecated.
        Creates a new datetime set at now.
        Returns:
        now datetime.
      • dateTimeAt

        public static DateTime dateTimeAt​(int... timeParts)
        Deprecated.
        Creates a new datetime from the specified parts of the time specification year month day hour minute second millisecond. The hour, minute, second and millisecond parts are optional; if not passed, they are set at 0. For example, the following patterns are valid:
        • at(2011, 5, 23, 10, 57, 23, 12) meaning in ISO 86601 2011-05-23T10:57:23.012
        • at(2011, 5, 23, 10, 57, 23) meaning in ISO 86601 2011-05-23T10:57:23.00
        • at(2011, 5, 23, 10, 57) meaning in ISO 86601 2011-05-23T10:57:00.00
        • at(2011, 5, 23, 10) meaning in ISO 86601 2011-05-23T10:00:00.00
        • at(2011, 5, 23) meaning in ISO 86601 2011-05-23T00:00:00.00
        Parameters:
        timeParts - the different parts of the datetime to set in the following order: year, month, day, hour, minute, second, millisecond. The year, month, and day are mandatory whereas other time parts are optional. If one optional part isn't passed, then it is set to 0.
        Returns:
        a datetime matching the specified datetime specification.
      • newInstanceFrom

        protected DateTime newInstanceFrom​(Date aDate)
        Deprecated.
        Description copied from class: AbstractDateTemporal
        Create a new instance from a given datetime in milliseconds.
        Specified by:
        newInstanceFrom in class AbstractDateTemporal<DateTime>
        Parameters:
        aDate - the datetime in milliseconds.
        Returns:
        the new temporal instance corresponding to the given time in milliseconds.
      • asDate

        public Date asDate()
        Deprecated.
        Description copied from interface: Temporal
        Gets the java Date representation of this temporal.
        Returns:
        a Date representation of this temporal.
      • toISO8601

        public String toISO8601()
        Deprecated.
        Description copied from interface: Temporal
        Gets an ISO 8601 textual representation of this temporal by taking into account of its underlying timezone. For datetime, the representation is at the accuracy to the second. The ISO 8601 format in which the date is returned is one of the more common in the Web, that is with the datetime separators (the hyphen for dates and the double-points for times): yyyy-MM-dd'T'HH:mm:ss where yyyy means the year in 4 digits, MM means the month in year in two digits, dd means the day in month in two digits, HH means the hour (24-o'clock) in two digits, mm means the minute in two digits, and ss the second in two digits.
        Returns:
        the ISO 8601 textual representation of this temporal.
      • toShortISO8601

        public String toShortISO8601()
        Deprecated.
        Description copied from interface: Temporal
        Gets an ISO 8601 textual representation of this temporal by taking into account of its underlying timezone. For datetime, the representation is at the accuracy to the minute. The ISO 8601 format in which the date is returned is one of the more common in the Web, that is with the datetime separators (the hyphen for dates and the double-points for times): yyyy-MM-dd'T'HH:mm:ss where yyyy means the year in 4 digits, MM means the month in year in two digits, dd means the day in month in two digits, HH means the hour (24-o'clock) in two digits, and mm means the minute in two digits.
        Returns:
        a short ISO 8601 textual representation of this temporal.
      • toICal

        public String toICal()
        Deprecated.
        Description copied from interface: Temporal
        Gets the ISO 8601 textual representation of this date as it is in the iCal specification. The returned iCal date representation is in this temporal's time zone. In the iCal specification, dates are represented in one of the ISO 8601 format, that is the complete format without any datetime separators (the hyphen character for dates and the double-points for times). In the iCal specification, no time zone information is added to the ISO 8601 representation of the date, nevertheless when the date is indicated in UTC, the 'Z' marker must be set in the date as required by the ISO 8601 standard.
        Returns:
        the iCal textual representation of this temporal and in the timezone of this temporal.
      • toICalInUTC

        public String toICalInUTC()
        Deprecated.
        Description copied from interface: Temporal
        Gets the ISO 8601 textual representation of this date as it is in the iCal specification. The returned iCal date representation is in explicitly set in UTC. In the iCal specification, dates are represented in one of the ISO 8601 format, that is the complete format without any date and time separators (the hyphen character for dates and the double-points for times). In the iCal specification, no time zone information is added to the ISO 8601 representation of the date, nevertheless when the date is indicated in UTC, the 'Z' marker must be set in the date as required by the ISO 8601 standard.
        Returns:
        the iCal textual representation of this temporal and in UTC.
      • inTimeZone

        public DateTime inTimeZone​(TimeZone timeZone)
        Deprecated.
        Description copied from interface: Temporal
        Sets the time zone this temporal is defined for. If no time zone is set, then the default one is considered (the timezone of the host). The time zone can have no meaning with some temporal types like for example simple date (day, month, and year).
        Parameters:
        timeZone - the time zone of this temporal.
        Returns:
        itself.
      • getTimeZone

        public TimeZone getTimeZone()
        Deprecated.
        Description copied from interface: Temporal
        Gets the time zone for which this temporal is defined.
        Returns:
        the time zone of this temporal.
      • isTimeSupported

        public boolean isTimeSupported()
        Deprecated.
        Description copied from interface: Temporal
        Is this temporal supports the time unit?
        Returns:
        true if this temporal supports the time unit. Time and datetime should return true here whereas date should return false.
      • isBefore

        public boolean isBefore​(DateTime anotherDatable)
        Deprecated.
        Description copied from interface: Temporal
        Is this temporal strictly before in time the specified another one?
        Parameters:
        anotherDatable - the another temporal to which this is compared.
        Returns:
        true if this temporal is strictly before the another one.
      • isAfter

        public boolean isAfter​(DateTime anotherDatable)
        Deprecated.
        Description copied from interface: Temporal
        Is this temporal strictly after in time the specified another one?
        Parameters:
        anotherDatable - the another temporal to which this is compared.
        Returns:
        true if this temporal is strictly after the another one.
      • isEqualTo

        public boolean isEqualTo​(DateTime anotherDatable)
        Deprecated.
        Description copied from interface: Temporal
        Is this temporal equal in time to the specified another one?
        Parameters:
        anotherDatable - the another temporal to which this is compared.
        Returns:
        true if this temporal is equal with the another one.
      • equals

        public boolean equals​(Object obj)
        Deprecated.
        Overrides:
        equals in class Date
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class Date
      • isBefore

        public boolean isBefore​(Date otherDate)
        Deprecated.
        Is the date in this datetime before the specified date.
        Parameters:
        otherDate - the other date.
        Returns:
        true if the date part of this datetime is before the other date.
      • isAfter

        public boolean isAfter​(Date otherDate)
        Deprecated.
        Is the date in this datetime after the specified date.
        Parameters:
        otherDate - the other date.
        Returns:
        true if the date part of this datetime is after the other date.
      • isEqualTo

        public boolean isEqualTo​(Date otherDate)
        Deprecated.
        Is the date in this datetime equal to the specified date.
        Parameters:
        otherDate - the other date.
        Returns:
        true if the date part of this datetime is equal to the other date.
      • toDate

        public Date toDate()
        Deprecated.
        Converts this datetime to a date. The time part of this datetime is lost.
        Returns:
        a date representation of this datetime.
      • toZoneDateTime

        public ZonedDateTime toZoneDateTime()
        Deprecated.
        Converts this datetime to a ZonedDateTime instance. The time part as well its timezone is kept.
        Returns:
        a zoned datetime representation of this datetime.
      • getOffsetTime

        public OffsetTime getOffsetTime()
        Deprecated.
        Gets the time of this datetime by taking into account the offset from UTC/Greenwich in the ISO-8601 calendar system.
        Returns:
        the time of this datetime.