Package org.opengis.cite.iso19142.util

# Class TimeUtils

java.lang.Object
org.opengis.cite.iso19142.util.TimeUtils

public class TimeUtils extends Object
Provides various utility methods for working with representations of temporal values.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TimeUtils()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Document`
  `instantAsGML(org.opengis.temporal.Instant instant, ZoneOffset offset)`
  Builds a GML representation of a time instant with the specified time-zone offset.
  `static Document`
  `instantAsGMLSubtractOneDay(org.opengis.temporal.Instant instant, ZoneOffset offset)`
  Builds a GML representation of a time instant with the specified time-zone offset.
  `static Document`
  `intervalAsGML(ZonedDateTime startDateTime, ZonedDateTime endDateTime)`
  Builds a GML representation of a time interval delimited by the given time instants.
  `static Document`
  `periodAsGML(org.opengis.temporal.Period period)`
  Builds a GML representation of the given time period.
  `static Document`
  `periodAsGML(org.opengis.temporal.Period period, ZoneOffset offset)`
  Builds a GML representation of the given time period.
  `static Document`
  `periodAsGMLAddOneDay(org.opengis.temporal.Period period)`
  Builds a GML representation of the given time period.
  `static Document`
  `periodAsGMLSubtractOneDay(org.opengis.temporal.Period period)`
  Builds a GML representation of the given time period.

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

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

- ## Constructor Details

  - ### TimeUtils

    public TimeUtils()

- ## Method Details

  - ### intervalAsGML

    public static Document intervalAsGML(ZonedDateTime startDateTime, ZonedDateTime endDateTime)
    Builds a GML representation of a time interval delimited by the given time instants. The temporal reference system is ISO 8601 (UTC).
    Parameters:
      `startDateTime` - The starting instant.
      `endDateTime` - The ending instant.
    Returns:
      A Document with gml:TimePeriod as the document element, or null if it cannot be created.

  - ### periodAsGML

    public static Document periodAsGML(org.opengis.temporal.Period period)
    Builds a GML representation of the given time period.
    Parameters:
      `period` - A Period representing a temporal interval (UTC).
    Returns:
      A Document with gml:TimePeriod as the document element.

  - ### periodAsGML

    public static Document periodAsGML(org.opengis.temporal.Period period, ZoneOffset offset)
    Builds a GML representation of the given time period.
    Parameters:
      `period` - A Period representing a temporal interval (UTC).
      `offset` - A time-zone offset from UTC ('Z' if null).
    Returns:
      A Document with gml:TimePeriod as the document element.

  - ### periodAsGMLSubtractOneDay

    public static Document periodAsGMLSubtractOneDay(org.opengis.temporal.Period period)
    Builds a GML representation of the given time period.
    Parameters:
      `period` - A Period representing a temporal interval (UTC).
    Returns:
      A Document with gml:TimePeriod as the document element. Subtracts one day from beginning and end, see https://github.com/opengeospatial/ets-wfs20/issues/199.

  - ### periodAsGMLAddOneDay

    public static Document periodAsGMLAddOneDay(org.opengis.temporal.Period period)
    Builds a GML representation of the given time period.
    Parameters:
      `period` - A Period representing a temporal interval (UTC).
    Returns:
      A Document with gml:TimePeriod as the document element. Adds one day to beginning and end, see https://github.com/opengeospatial/ets-wfs20/issues/226.

  - ### instantAsGML

    public static Document instantAsGML(org.opengis.temporal.Instant instant, ZoneOffset offset)
    Builds a GML representation of a time instant with the specified time-zone offset.
    Parameters:
      `instant` - An instant representing a position in time.
      `offset` - A time-zone offset from UTC ('Z' if null).
    Returns:
      A Document with gml:TimeInstant as the document element.

  - ### instantAsGMLSubtractOneDay

    public static Document instantAsGMLSubtractOneDay(org.opengis.temporal.Instant instant, ZoneOffset offset)
    Builds a GML representation of a time instant with the specified time-zone offset.
    Parameters:
      `instant` - An instant representing a position in time.
      `offset` - A time-zone offset from UTC ('Z' if null).
    Returns:
      A Document with gml:TimeInstant as the document element. Subtracts one day from the instant, see https://github.com/opengeospatial/ets-wfs20/issues/199.