I inserted data in MongoDB
via PHP
and one field is a date. So, according to the MongoDB documentation, I used a new MongoDate()
to do that.
In MongoDB, The date is stored such as ISODate("2013-07-03T22:56:12Z")
. That means my timezone is Z
(= 0Z
), so the timezone is equal to 0.
But I am in the US West coast and the timezone for my location is 8Z
(Pacific Time).
When I type new Date()
on Mongo in the terminal, everythin g is OK. The date is ISODate("2013-07-03T22:56:128Z")
, so this is the correct timezone 8Z
.
My development environment is Windows and MongoDB is version 2.4.4
Is there something to setup in MongoDB, in the PHP code or in the php.ini to avoid this error?