Class XMPDateTimeUtils


  • public final class XMPDateTimeUtils
    extends java.lang.Object
    • Constructor Detail

      • XMPDateTimeUtils

        public XMPDateTimeUtils()
    • Method Detail

      • getCurrentDateTime

        public static XMPDateTime getCurrentDateTime()
        Obtain the current date and time.
        Returns:
        Returns The returned time is UTC, properly adjusted for the local time zone. The resolution of the time is not guaranteed to be finer than seconds.
      • convertToLocalTimeZone

        public static XMPDateTime convertToLocalTimeZone​(XMPDateTime dateTime,
                                                         boolean adjustTime)
        Set to the local time zone (local timezone is provided by the OS). if adjustTime is false no other existing time zone value is replaced, the other date/time fields are not adjusted in any way. If adjustTime is true, the time is adjusted based on the local time zone.
        Parameters:
        dateTime - the XMPDateTime variable containing the value to be modified.
        adjustTime - flag if the time should be adjusted based on the time
        Returns:
        Returns an updated XMPDateTime-object.
      • convertToUTCTime

        public static XMPDateTime convertToUTCTime​(XMPDateTime dateTime)
        Make sure a time is UTC. If the time zone is not UTC, the time is adjusted and the time zone set to be UTC.
        Parameters:
        dateTime - the XMPDateTime variable containing the time to be modified.
        Returns:
        Returns an updated XMPDateTime-object.