# Compatibility issue with OGM java.util.Date and Temporal instant creation functions

**URL:** <https://community.neo4j.com/t/compatibility-issue-with-ogm-java-util-date-and-temporal-instant-creation-functions/6081>\
**Category:** Spring Data Neo4j & Neo4j-OGM\
**Created:** [March 26, 2019, 8:02pm UTC](https://community.neo4j.com/t/compatibility-issue-with-ogm-java-util-date-and-temporal-instant-creation-functions/6081 "2019-03-26T20:02:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Jiropole](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jiropole/32/223_2.png) [@Jiropole](https://community.neo4j.com/u/Jiropole)\
**Post date:** [April 1, 2019, 10:33pm UTC](https://community.neo4j.com/t/compatibility-issue-with-ogm-java-util-date-and-temporal-instant-creation-functions/6081/2 "2019-04-01T22:33:39Z")

</div>

I'm not sure if it's related, but as far as I know, OGM does not yet support the native chrono or spatial Neo4j types. This is true for me on Neo4j 3.4.5 / OGM 3.1.2. I just re-proved this early today by attempting to set dates on nodes in a plugin, using `OffsetDateTime.now().toInstant()`, and then map via OGM to a Date field on my entity, which results in the error.

My simple workaround (until this is addressed) is to store `OffsetDateTime.now().toInstant().toEpochMilli()` in the DB, and use a `long` in my entity, which maps fine. Then again, I'm just passing them through, or this might be more annoying. There may be [better workarounds](https://community.neo4j.com/t/how-to-use-neo4j-native-types-with-sdn-and-ogm/4442/3), and/or they may fix this in OGM 3.2.

---

_[View the full topic](https://community.neo4j.com/t/compatibility-issue-with-ogm-java-util-date-and-temporal-instant-creation-functions/6081)._
