Creating a datetime native type with spring-data-neo4

I'm trying to create a neo4j native datetime type (Temporal (Date/Time) values - Neo4j Cypher Manual) with spring data neo4j. I have a rest controller which takes an object as parameter, this object is then directly saved to neo4j.
I skip the rest controller, I'll give later the implementation of the object.
I'm using


and all packages with <groupId>org.neo4j</groupId> use version 3.2.2.

I'm using the following pieces of forum and documentation :

Based on this, I wrote an object and a no op converter:

public class MyObject{
    private ZonedDateTime testDate;
// + getter and setter

NoOpZonedDateTimeConversion :

public class NoOpZonedDateTimeConversion implements AttributeConverter<LocalDateTime, LocalDateTime> {
  public LocalDateTime toGraphProperty(LocalDateTime value) {
    return value;

  public LocalDateTime toEntityAttribute(LocalDateTime value) {
    return value;

This registers a string in my database (neo 3.5.5-enterprise).
I tried a few converters with various native java date type, I tried without converter, simple question : is it suppose to work or am I missing something ?

You have to opt-in to enable the native type support. More details in this great blog post (section Native types support) written by @michael.simons.
The key ingredient is to add (assuming you are using bolt protocol) the native type support dependency


and enable it either via,


the Configuration definition

Configuration configuration = new Configuration.Builder()

or if you are using Spring Boot for your application you can do this (starting from Spring Boot 2.2) via the
1 Like

Thanks for the help, so far I did not succeed to register a ZonedDateTime native java object in the database as a neo4j DateTime.
I'm using spring boot and I enabled native types in my application.yml. I also added the maven dependancy neo4j-ogm-bolt-native-types.

My NodeEntity has a ZonedateTime private parameter with accessors.
I'm posting a json with this date : "1996-10-15T00:05:32.000Z" and I end up with 1996-10-15T00:05:32[UTC] in the database. I suspect that it might also be a problem with spring boot deserialization of java date types, I'll have to investigate but that will be for another time I'm afraid.

Thanks for the help :)

Sorry it took me a while but just to close this thread :
I run now neo4j 4.1 with docker
I have added in my pom




In application.yml :

            use-native-types: "true"

I have a property in a node entity with getters and setters
LocalDateTime date;

And I can now register LocalDateTime directly in my DB which is great necause I have access to all methods and tools of Date and Time in neo4j (better than String imo)

Thanks for the good job.