Is there a way to store datetime? So that I can calculate time difference between two datetimes and query with range of datetime.
Also I want to indicate an exact time. ex) 12:00:00 01-Jan-2001
Should I store both unix-stamp time and datetime string with timezone or other better ways to handle this problem?
You should use the MongoDate class for storing dates in MongoDB.
From the manual…
You can convert these to
DateTimeobjects by retrieving thesecproperty and using it inDateTime::setTimestamp(). Also seeDateTime::setTimezone()