O'Reilly logo

PHP and MySQL™ Phrasebook by Christian Wenz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3. Date and Time

Most of the time, the date and time functionalities of PHP 5 are used for printing out the current date and time—to pretend that the Web page is up-to-date. (You would be surprised how many larger Web sites actually use this.) But apart from that, working with date and time in PHP offers many other possibilities, most of which you will find in this chapter. As of PHP version 5.2, the completely new DateTime extension was added to the PHP core. Of course, this does not affect existing functionality, which continues to work fine, but there are some new features, some of them also covered in this chapter.

First, though, it seems appropriate to take a look at the PHP function that is probably used the most for working with dates: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required