14.2.2.3 APIs for Accessing Datetime Data

The graph server (PGX) uses the new Java 8 temporal data types for accessing datetime data through the Java API:
  • date in PGX maps to LocalDate in Java
  • time in PGX maps to LocalTime in Java
  • timestamp in PGX maps to LocalDateTime in Java
  • time with time zone in PGX maps to OffsetTime in Java
  • timestamp with time zone in PGX maps to OffsetDateTime in Java

You can retrieve a date as shown in the following code:

opg4j> var dateOfBirthProperty = graph.getVertexProperty("date_of_birth")
opg4j> var birthdayOfJudy = dateOfBirthProperty.get(1)
import java.time.LocalDate;
import oracle.pgx.api.*;
...
VertexProperty<LocalDate> dateOfBirthProperty = graph.getVertexProperty("date_of_birth");
LocalDate birthdayOfJudy = dateOfBirthProperty.get(1);
date_of_birth_property = graph.get_vertex_property("date_of_birth")
birthday_of_judy = date_of_birth_property.get(1)