/// <summary>
        /// Sets the local time zone without touching any other Any existing time zone value is replaced,
        /// the other date/time fields are not adjusted in any way.
        /// </summary>
        /// <param name="dateTime"> the <code>XMPDateTime</code> variable containing the value to be modified. </param>
        /// <returns> Returns an updated <code>XMPDateTime</code>-object. </returns>
        public static IXmpDateTime SetLocalTimeZone(IXmpDateTime dateTime)
        {
            XmpCalendar cal = dateTime.Calendar;

            cal.TimeZone = TimeZone.CurrentTimeZone;
            return(new XmpDateTimeImpl(cal));
        }
        /// <summary>
        /// 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.
        /// </summary>
        /// <param name="dateTime">
        ///            the <code>XMPDateTime</code> variable containing the time to
        ///            be modified. </param>
        /// <returns> Returns an updated <code>XMPDateTime</code>-object. </returns>
        public static IXmpDateTime ConvertToUtcTime(IXmpDateTime dateTime)
        {
            long        timeInMillis = dateTime.Calendar.TimeInMillis;
            XmpCalendar cal          = new XmpCalendar();

            cal.TimeInMillis = timeInMillis;
            return(new XmpDateTimeImpl(cal));
        }
        /// <summary>
        /// Make sure a time is local. If the time zone is not the local zone, the time is adjusted and
        /// the time zone set to be local.
        /// </summary>
        /// <param name="dateTime"> the <code>XMPDateTime</code> variable containing the time to be modified. </param>
        /// <returns> Returns an updated <code>XMPDateTime</code>-object. </returns>
        public static IXmpDateTime ConvertToLocalTime(IXmpDateTime dateTime)
        {
            long timeInMillis = dateTime.Calendar.TimeInMillis;
            // has automatically local timezone
            XmpCalendar cal = new XmpCalendar();

            cal.TimeInMillis = timeInMillis;
            return(new XmpDateTimeImpl(cal));
        }
예제 #4
0
 /// <summary>
 /// Creates an <code>XMPDateTime</code> from a <code>Calendar</code>-object.
 /// </summary>
 /// <param name="calendar"> a <code>Calendar</code>-object. </param>
 /// <returns> An <code>XMPDateTime</code>-object. </returns>
 public static IXmpDateTime CreateFromCalendar(XmpCalendar calendar) {
     return new XmpDateTimeImpl(calendar);
 }
예제 #5
0
 /// <summary>
 /// Make sure a time is local. If the time zone is not the local zone, the time is adjusted and
 /// the time zone set to be local.
 /// </summary>
 /// <param name="dateTime"> the <code>XMPDateTime</code> variable containing the time to be modified. </param>
 /// <returns> Returns an updated <code>XMPDateTime</code>-object. </returns>
 public static IXmpDateTime ConvertToLocalTime(IXmpDateTime dateTime) {
     long timeInMillis = dateTime.Calendar.TimeInMillis;
     // has automatically local timezone
     XmpCalendar cal = new XmpCalendar();
     cal.TimeInMillis = timeInMillis;
     return new XmpDateTimeImpl(cal);
 }
예제 #6
0
 /// <summary>
 /// 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.
 /// </summary>
 /// <param name="dateTime">
 ///            the <code>XMPDateTime</code> variable containing the time to
 ///            be modified. </param>
 /// <returns> Returns an updated <code>XMPDateTime</code>-object. </returns>
 public static IXmpDateTime ConvertToUtcTime(IXmpDateTime dateTime) {
     long timeInMillis = dateTime.Calendar.TimeInMillis;
     XmpCalendar cal = new XmpCalendar();
     cal.TimeInMillis = timeInMillis;
     return new XmpDateTimeImpl(cal);
 }
 /// <summary>
 /// Creates an <code>XMPDateTime</code> from a <code>Calendar</code>-object.
 /// </summary>
 /// <param name="calendar"> a <code>Calendar</code>-object. </param>
 /// <returns> An <code>XMPDateTime</code>-object. </returns>
 public static IXmpDateTime CreateFromCalendar(XmpCalendar calendar)
 {
     return(new XmpDateTimeImpl(calendar));
 }