## org.exist.xquery.value
Class TimeUtils

    java.lang.Object
      org.exist.xquery.value.TimeUtils

public class TimeUtils
extends java.lang.Object

Centralizes access to time-related utility functions. Mostly delegates to the XML datatype factory, serving as a central chokepoint to control concurrency issues. It's not clear if instances of the factory are in fact thread-safe or not; if they turn out not to be, it will be easy to either synchronize access or create more instances here as required.

Author:
  Piotr Kaminski

Method Summary
`static TimeUtils` `getInstance()`
`int` `getLocalTimezoneOffsetMillis()`
`int` `getLocalTimezoneOffsetMinutes()`
`javax.xml.datatype.Duration` `newDuration(boolean arg0, java.math.BigInteger arg1, java.math.BigInteger arg2, java.math.BigInteger arg3, java.math.BigInteger arg4, java.math.BigInteger arg5, java.math.BigDecimal arg6)`
`javax.xml.datatype.Duration` `newDuration(boolean arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6)`
`javax.xml.datatype.Duration` `newDuration(long arg0)`
`javax.xml.datatype.Duration` `newDuration(java.lang.String arg0)`
`javax.xml.datatype.Duration` `newDurationDayTime(boolean arg0, java.math.BigInteger arg1, java.math.BigInteger arg2, java.math.BigInteger arg3, java.math.BigInteger arg4)`
`javax.xml.datatype.Duration` `newDurationDayTime(boolean arg0, int arg1, int arg2, int arg3, int arg4)`
`javax.xml.datatype.Duration` `newDurationDayTime(long arg0)`
`javax.xml.datatype.Duration` `newDurationDayTime(java.lang.String arg0)`
`javax.xml.datatype.Duration` `newDurationYearMonth(boolean arg0, java.math.BigInteger arg1, java.math.BigInteger arg2)`
`javax.xml.datatype.Duration` `newDurationYearMonth(boolean arg0, int arg1, int arg2)`
`javax.xml.datatype.Duration` `newDurationYearMonth(long arg0)`
`javax.xml.datatype.Duration` `newDurationYearMonth(java.lang.String arg0)`
`javax.xml.datatype.XMLGregorianCalendar` `newXMLGregorianCalendar()`
`javax.xml.datatype.XMLGregorianCalendar` `newXMLGregorianCalendar(java.math.BigInteger arg0, int arg1, int arg2, int arg3, int arg4, int arg5, java.math.BigDecimal arg6, int arg7)`
`javax.xml.datatype.XMLGregorianCalendar` `newXMLGregorianCalendar(java.util.GregorianCalendar arg0)`
`javax.xml.datatype.XMLGregorianCalendar` `newXMLGregorianCalendar(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)`
`javax.xml.datatype.XMLGregorianCalendar` `newXMLGregorianCalendar(java.lang.String arg0)`
`javax.xml.datatype.XMLGregorianCalendar` `newXMLGregorianCalendarDate(int arg0, int arg1, int arg2, int arg3)`
`javax.xml.datatype.XMLGregorianCalendar` `newXMLGregorianCalendarTime(int arg0, int arg1, int arg2, java.math.BigDecimal arg3, int arg4)`
`javax.xml.datatype.XMLGregorianCalendar` `newXMLGregorianCalendarTime(int arg0, int arg1, int arg2, int arg3)`
`javax.xml.datatype.XMLGregorianCalendar` `newXMLGregorianCalendarTime(int arg0, int arg1, int arg2, int arg3, int arg4)`
`void` `overrideLocalTimezoneOffset(int millis)` Set the offset of the local timezone, ignoring the default provided by the OS.
`void` `resetLocalTimezoneOffset()` Cancel any timezone override that may be in effect, reverting back to the OS value.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static TimeUtils getInstance()

### overrideLocalTimezoneOffset

    public void overrideLocalTimezoneOffset(int millis)

  Set the offset of the local timezone, ignoring the default provided by the OS. Mainly useful for testing.

  Parameters:
    `millis` - the timezone offset in milliseconds, positive or negative

### resetLocalTimezoneOffset

    public void resetLocalTimezoneOffset()

  Cancel any timezone override that may be in effect, reverting back to the OS value.

### getLocalTimezoneOffsetMillis

    public int getLocalTimezoneOffsetMillis()

### getLocalTimezoneOffsetMinutes

    public int getLocalTimezoneOffsetMinutes()

### newDuration

    public javax.xml.datatype.Duration newDuration(long arg0)

### newDuration

    public javax.xml.datatype.Duration newDuration(java.lang.String arg0)

### newDuration

    public javax.xml.datatype.Duration newDuration(boolean arg0,
                                                   int arg1,
                                                   int arg2,
                                                   int arg3,
                                                   int arg4,
                                                   int arg5,
                                                   int arg6)

### newDuration

    public javax.xml.datatype.Duration newDuration(boolean arg0,
                                                   java.math.BigInteger arg1,
                                                   java.math.BigInteger arg2,
                                                   java.math.BigInteger arg3,
                                                   java.math.BigInteger arg4,
                                                   java.math.BigInteger arg5,
                                                   java.math.BigDecimal arg6)

### newDurationDayTime

    public javax.xml.datatype.Duration newDurationDayTime(long arg0)

### newDurationDayTime

    public javax.xml.datatype.Duration newDurationDayTime(java.lang.String arg0)

### newDurationDayTime

    public javax.xml.datatype.Duration newDurationDayTime(boolean arg0,
                                                          int arg1,
                                                          int arg2,
                                                          int arg3,
                                                          int arg4)

### newDurationDayTime

    public javax.xml.datatype.Duration newDurationDayTime(boolean arg0,
                                                          java.math.BigInteger arg1,
                                                          java.math.BigInteger arg2,
                                                          java.math.BigInteger arg3,
                                                          java.math.BigInteger arg4)

### newDurationYearMonth

    public javax.xml.datatype.Duration newDurationYearMonth(long arg0)

### newDurationYearMonth

    public javax.xml.datatype.Duration newDurationYearMonth(java.lang.String arg0)

### newDurationYearMonth

    public javax.xml.datatype.Duration newDurationYearMonth(boolean arg0,
                                                            int arg1,
                                                            int arg2)

### newDurationYearMonth

    public javax.xml.datatype.Duration newDurationYearMonth(boolean arg0,
                                                            java.math.BigInteger arg1,
                                                            java.math.BigInteger arg2)

### newXMLGregorianCalendar

    public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar()

### newXMLGregorianCalendar

    public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(int arg0,
                                                                           int arg1,
                                                                           int arg2,
                                                                           int arg3,
                                                                           int arg4,
                                                                           int arg5,
                                                                           int arg6,
                                                                           int arg7)

### newXMLGregorianCalendar

    public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(java.lang.String arg0)

### newXMLGregorianCalendar

    public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(java.math.BigInteger arg0,
                                                                           int arg1,
                                                                           int arg2,
                                                                           int arg3,
                                                                           int arg4,
                                                                           int arg5,
                                                                           java.math.BigDecimal arg6,
                                                                           int arg7)

### newXMLGregorianCalendar

    public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendar(java.util.GregorianCalendar arg0)

### newXMLGregorianCalendarDate

    public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarDate(int arg0,
                                                                               int arg1,
                                                                               int arg2,
                                                                               int arg3)

### newXMLGregorianCalendarTime

    public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarTime(int arg0,
                                                                               int arg1,
                                                                               int arg2,
                                                                               int arg3)

### newXMLGregorianCalendarTime

    public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarTime(int arg0,
                                                                               int arg1,
                                                                               int arg2,
                                                                               int arg3,
                                                                               int arg4)

### newXMLGregorianCalendarTime

    public javax.xml.datatype.XMLGregorianCalendar newXMLGregorianCalendarTime(int arg0,
                                                                               int arg1,
                                                                               int arg2,
                                                                               java.math.BigDecimal arg3,
                                                                               int arg4)

Copyright (C) Wolfgang Meier. All rights reserved.