Package net.sf.saxon.functions

## Class ParseIetfDate

- java.lang.Object
- - net.sf.saxon.functions.AbstractFunction
  - - net.sf.saxon.functions.SystemFunction
    - - net.sf.saxon.functions.ParseIetfDate

- All Implemented Interfaces:
    `Callable`, `Function`, `GroundedValue`, `Item`, `Sequence`

      public class ParseIetfDate
      extends SystemFunction
      implements Callable

  This class implements the function parse-ietf-date(), which is a standard function in XPath 3.1

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ParseIetfDate()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ZeroOrOne` | `call​(XPathContext context, Sequence[] arguments)` | Evaluate the expression
    `static boolean` | `isValidTime​(int hour, int minute, int second, int microsecond, int tz)` | Determine whether a given time is valid
    `DateTimeValue` | `parse​(java.lang.String input, XPathContext context)` | Parse a supplied string to obtain a dateTime
    `int` | `parseTime​(java.util.List<java.lang.String> tokens, int currentPosition, java.util.List<TimeValue> result, java.lang.String input)` | Parse part of a string (already tokenized) to obtain a TimeValue

    - ### Methods inherited from class net.sf.saxon.functions.SystemFunction

      `dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getCompilerName, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, importAttributes, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller`

    - ### Methods inherited from class net.sf.saxon.functions.AbstractFunction

      `atomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheck`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface net.sf.saxon.om.Function

      `getGenre`

    - ### Methods inherited from interface net.sf.saxon.om.GroundedValue

      `asIterable, concatenate, containsNode, materialize`

    - ### Methods inherited from interface net.sf.saxon.om.Item

      `getLength, head, isStreamed, itemAt, iterate, reduce, subsequence`

    - ### Methods inherited from interface net.sf.saxon.om.Sequence

      `makeRepeatable`

- - ### Constructor Detail

    - #### ParseIetfDate

          public ParseIetfDate()

  - ### Method Detail

    - #### call

          public ZeroOrOne call​(XPathContext context,
                                Sequence[] arguments)
                         throws XPathException

      Evaluate the expression
      Specified by:
        `call` in interface `Callable`
      Specified by:
        `call` in interface `Function`
      Parameters:
        `context` - the dynamic evaluation context
        `arguments` - the values of the arguments, supplied as Sequence objects
      Returns:
        the result of the evaluation, in the form of a Sequence
      Throws:
        `XPathException` - if a dynamic error occurs during the evaluation of the expression

    - #### parse

          public DateTimeValue parse​(java.lang.String input,
                                     XPathContext context)
                              throws XPathException

      Parse a supplied string to obtain a dateTime
      Parameters:
        `input` - a string containing the date and time in IETF format
        `context` - the XPath context
      Returns:
        either a DateTimeValue representing the input supplied, or a ValidationFailure if the input string was invalid
      Throws:
        `XPathException`

    - #### parseTime

          public int parseTime​(java.util.List<java.lang.String> tokens,
                               int currentPosition,
                               java.util.List<TimeValue> result,
                               java.lang.String input)
                        throws XPathException

      Parse part of a string (already tokenized) to obtain a TimeValue
      Parameters:
        `tokens` - tokenized string containing the date and time in IETF format
        `currentPosition` - index of current token
        `result` - TimeValue produced from parsing time from tokens
      Returns:
        index of token after parsing the time
      Throws:
        `XPathException`

    - #### isValidTime

          public static boolean isValidTime​(int hour,
                                            int minute,
                                            int second,
                                            int microsecond,
                                            int tz)

      Determine whether a given time is valid
      Parameters:
        `hour` - the hour (0-24)
        `minute` - the minute (0-59)
        `second` - the second (0-59)
        `microsecond` - the microsecond (0-999999)
        `tz` - the timezone displacement in minutes from UTC
      Returns:
        true if this is a valid time