Cypher Functions: How can i get the current timestamp (like now() function)?

865 views
Skip to first unread message

Michel Ávila

unread,
Feb 14, 2013, 7:19:52 AM2/14/13
to ne...@googlegroups.com
I want to set a datetime property on some relationships using SET.
Something like:

set r.ts = now()

Any clue?

Peter Neubauer

unread,
Feb 14, 2013, 7:52:45 AM2/14/13
to Neo4j User

Michel,
you want to store time as LONG, maybe as a parameter, something like

Map parameters = new HasMap()
parameters.put("date",new Date().getTime());
....

set r.ts = {date}

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michel Ávila

unread,
Feb 14, 2013, 3:51:17 PM2/14/13
to ne...@googlegroups.com
Hi Peter, thank you for the help.

By the way it looks, i feel like i can't simply put these statements in the middle of a cypher query, can i?
I must set these parameters before running the cypher query right?


Best regards,

Michael Hunger

unread,
Feb 14, 2013, 9:18:55 PM2/14/13
to ne...@googlegroups.com
Ya that's the way right now.

Cheers

Michael

(neo4j.org) <-[:WORKS_ON]- (@mesirii) -[:TAKES_CARE_OF]-> (you) -[:WORKS_WITH]->(@Neo4j)



Michel Ávila

unread,
Feb 15, 2013, 7:01:56 AM2/15/13
to ne...@googlegroups.com
Thank you Michael!

Gonna try it out and see if it works.
BRB
Reply all
Reply to author
Forward
0 new messages