Check your understanding
Lesson Summary
In this lesson, you learned about working with temporal types in Neo4j using the Go driver:
-
The
neo4jpackage provides types for handling dates, times, and durations -
You can pass Go time objects as parameters or create them within Cypher statements
-
When reading temporal values from Neo4j, they are automatically converted to the appropriate Go driver types
-
Durations can be used for date arithmetic in both Go and Cypher
Converting between driver and standard library types
The Neo4j Go driver’s temporal types (like neo4j.Date) are different from Go’s standard library types (like time.Time). If you need to convert between them:
-
To convert from driver types to standard library: use the
.Time()method -
To convert from standard library to driver types: use the
*Of()functions likeDateOf(),LocalDateTimeOf(), etc.