neo4j/community — Issue #129: Cypher feature: Date manipulation
Author: jakewins
Created: 2011-12-14 09:24:03+00:00
State: open
Labels: cypher, feature

It would be super cool if Cypher could treat Neo4j long properties as timestamps, and perform SQL-like date operations on them.. Seems SQL date manipulation is implementation-dependent, MYSQL offers stuff like this:

NOW()	Returns the current date and time
CURDATE()	Returns the current date
CURTIME()	Returns the current time
DATE()	Extracts the date part of a date or date/time expression
EXTRACT()	Returns a single part of a date/time
DATE_ADD()	Adds a specified time interval to a date
DATE_SUB()	Subtracts a specified time interval from a date
DATEDIFF()	Returns the number of days between two dates
DATE_FORMAT() Displays date/time data in different formats

in SQLServer:

GETDATE()	Returns the current date and time
DATEPART()	Returns a single part of a date/time
DATEADD()	Adds or subtracts a specified time interval from a date
DATEDIFF()	Returns the time between two dates
CONVERT()	Displays date/time data in different formats

Figure that can be used as feature-inspiration. Perhaps something like:

WHERE years(now() - user.birthday) > 15
AND day(user.birthday) = 2
RETURN user