cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Unknown function 'date'/'datetime'

HI every one i have a problem with date and datetime functions.
I have a node with date property which is stored as timestamp in our db
When i want to convert this property from time stamp to date neo4j says Unknown function 'date'
it is the same with datetime function.
Is this functions exists at all !!!???????!??????!?????//
All examples i see like this:

return date(datetime({epochmillis:timestamp()}))
``` or this:

datetime({ epochMillis: 424797300000 }) AS theDate

not working .
This is a simplest example of query i just want to convert timestamp to date

MATCH(v:Venue)-[:STORAGE_LOCATIONS]->(s:StorageLocation)<-[:IS_STORED_IN]-(i:Item)
WHERE v.uuid = '32372732-41da-4b9b-a524-413ccf1c4918'
WITH v,i, i.createdAt AS itemDate
RETURN v.name, i.itemTitle,date({epochMillis: itemDate})AS time
What im doing wrong ???
8 REPLIES 8

Can you please provide more detail?
Neo4j Version?
Through what client is the query submitted? Neo4j Browser (http://localhost:7474), bin/cypher-shell, or some other?

If running Neo4j 3.5.9 and submitted via bin/cypher-shell this is a known issue addressed in a later release of Neo4j. Please upgrade to Neo4j 3.5.12

The version is 2.0.0-M10
The client is Neo4j Browser (http://localhost:7474)

The version of Neo4j is 2.0.0-M10? is that correct?
As our most recent Neo4j version is 3.5.12, 2.0.0-M10 is years old?

Thanks Mr Canzano this must be the problem.

Mr Canzano im still having a problem with datetime() functions even with 3.0.5 version of neo4j client!
Same message unknown function is it available only in apoc library? because we not using it for now

if i understand correctly you are using Neo4j v3.0.5? Is that correct? If so this is somewhat an old version https://neo4j.com/release-notes/neo4j-3-0-5/ as it was released Sept 9, 2016, some 3+ years ago.
Further much of the temporal data and functions were introduced in Neo4j 3.4. But if you are going to upgrade I'd suggest not using 3.4 but rather use the most current release, namely 3.5.12 ( https://neo4j.com/download-center/ ) .

Is there a reason to use such older versions/software?

Well, i can't say why we use older version's of neo4j client in our project but i glad you spend time to answer me.Unfortunatelly im still not able to use this sugar methods but that make's me to work more looking for workaround's
I allready rise the question about the db Update future will show me better what will hapend have nie eve and thanks again for a quick answer

also for what its worth regarding introduction of the temporal functions and as introduced in Neo4j 3.4 this is documented at

https://neo4j.com/docs/cypher-manual/3.4/syntax/temporal/

change the URL and replace the reference to 3.4 to 3.5 and you will see the current documentation where here to we document said functions.

However if you change the url and replace 3.4 to 3.3 you will get a HTML 404 Page Not Found error. Of course this doesnt guarentee the page doesent exist, and therefor the functions may not exist. For surely in 3.3 we could have documented if they existed and simply provided a different URL structure. However this is not the case. These functions were introduced in 3.4 and available in said version and versions forward