Help with redis date format

138 views
Skip to first unread message

Кристина Лаптева

unread,
Jun 17, 2014, 8:31:25 AM6/17/14
to redi...@googlegroups.com
I have code
using (var client = RedisClientsManager.GetClient())
            {
                var infoKey = RedisKeys.Reports.GetInfoKey(reportKey);

                client.Set(infoKey, reportInfo, ttl);
}

ReportInfo contain key "execAt" with {6/17/2014 12:28:24 PM} value
ttl is {7.00:00:00} value
After client.Set in Redis added new key
"{\"execAt\":\"\\/Date(1403002249650)\\/\}"

why such a date format and how do I get the format {6/17/2014 12:28:24 PM} ???

Help me, please!

Josiah Carlson

unread,
Jun 17, 2014, 11:07:22 AM6/17/14
to redi...@googlegroups.com
Whatever client library you are using is converting your date + time object into a Javascript-like Date object, because your reportInfo object is being JSON-encoded before being sent to Redis. If you want to convert that data back, you may want to look into what JSON libraries are available for your language. There is also a chance that you can have your client library perform the conversion back to your language-native date + time object. What programming language and client library are you using?

 - Josiah



--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages