QnaList > Groups > Mongodb-User > May 2015
faq

[mongodb-user] C++ Mongoclient: Convert Mongodb ISODate Number To Date Format

I have imported data from a csv file into the mongo database using 
mongoimport.
The data contains a date which is converted to an ISODate.
When reading the data using C++ and the mongoclient (mongo-cxx-driver), the 
date is returned as a number, apparently the number of milliseconds since 
the epoch:
p.getField("DataDate")
DataDate: new Date(1024963200000)
BSONElement DataDate = p.getField("DataDate");
1024963200000
I did not see a BSONElement which would return the date in the original 
date format, ie mm/dd/yyyy.
Could anyone recommend the easiest method in C++ to get the original date 
or to convert this number to the original date, say mm/dd/yyyy?
Many thanks
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/d7529b94-2aae-4426-85d7-d36be237963e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

asked May 21 2015 at 06:55

nigel.sperinckgmail.com's gravatar image



Related discussions

Tagged

Group Mongodb-user

asked May 21 2015 at 06:55

active May 21 2015 at 06:55

posts:1

users:1

©2013 QnaList.com . QnaList is part of ZisaTechnologies LLC.