org.apache.tinkerpop.gremlin.util

## Class DatetimeHelper

- java.lang.Object
- - org.apache.tinkerpop.gremlin.util.DatetimeHelper

-     public final class DatetimeHelper
      extends Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Date` | `datetime(String d)` A proxy call to `parse(String)` but allows for syntax similar to Gremlin grammar of `datetime()`.
    `static String` | `format(Instant d)` Formats an `Instant` to a form of `2018-03-22T00:35:44Z` at UTC.
    `static Date` | `parse(String d)` Parses a `String` representing a date and/or time to a `Date` object with a default time zone offset of UTC (+00:00).

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

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

- - ### Method Detail

    - #### format

          public static String format(Instant d)

      Formats an `Instant` to a form of `2018-03-22T00:35:44Z` at UTC.

    - #### parse

          public static Date parse(String d)

      Parses a `String` representing a date and/or time to a `Date` object with a default time zone offset of UTC (+00:00). It can parse dates in any of the following formats.
      - 2018-03-22
      - 2018-03-22T00:35:44
      - 2018-03-22T00:35:44Z
      - 2018-03-22T00:35:44.741
      - 2018-03-22T00:35:44.741Z
      - 2018-03-22T00:35:44.741+1600
      >

    - #### datetime

          public static Date datetime(String d)

      A proxy call to `parse(String)` but allows for syntax similar to Gremlin grammar of `datetime()`.

Copyright © 2013–2022 Apache Software Foundation. All rights reserved.