I store current time in Redis as an integer with:

        timeStamp = (new Date()).getTime()

then on retrieval  

        date = new Date(timeStamp)

to get a Date object

Was easier for me than serializing an object

-- Dick

On Mar 20, 2012, at 12:42 AM, Angelo Chen wrote:

> Hi,
> 
> I use redis to store data, how to save the datetime data in redis that
> can be easily used later back to javascript?
> 
> tried var d = new Date()
> s = d.toISOString()
> it saves as a string, but Date.parse(s) seems not converting it back
> correctly, any hints?
> 
> Thanks,
> 
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to