News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Christian Schaefer's Blog:
Beware of the timezone! Working with PHP DateTime & Doctrine for MongoDB
September 06, 2011 @ 13:50:38

Christian Schaefer has a recent post pointing out a common frustration among developers of applications with NoSQL backends, specifically with Doctrine, MongoDB and PHP DateTime objects - timezone conflicts.

I really like Doctrines way of dealing with dates and times. Instead of passing timestamps around or strings with ISO date format it simply makes use of the PHP native type DateTime which provides all you really need to work with. PHPs interface to MongoDB however comes with its own MongoDate type which provides hardly any functionality compared to DateTime and it's not compatible with it. So what's the difference?

In some of the comments to the post, readers mention that the problem is bigger than just the tools used to work with the database, it's that databases usually don't care about timezones when working with date/time. There's also an interesting mention further down about the timezone support MongoDB does have and an example snippet ofo code that uses the support.

0 comments voice your opinion now!
timezone datetime mongodb nosql database conflict


blog comments powered by Disqus

Similar Posts

Lukas Smith's Blog: Next MDB2 releases are around the corner

DevShed: Generating Web Pages in Multiple Languages with a PHP IP-to-Country Mapping Application

Artur Ejsmont's Blog: How to build mongodb pecl extension in 32bit for PHP 5.2 on OSX Snow Leaopard

PHPBuilder.com: Implementing Automatic Database Backup and Optimization in PHP

PHP-Tools Blog: New releases of patTemplate and patForms


Community Events





Don't see your event here?
Let us know!


library tips conference release language bugfix framework series symfony interview list developer podcast laravel api community voicesoftheelephpant introduction zendserver deployment

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework