Hudzilla.org - the homepage of Paul Hudson PHP and PHP
Contents > Functions Wish List | Report Bug | About Me ]

4.5     Working with Date and Time

NOTE: This is NOT the latest copy of this book; click here for the latest version.

Being able to work easily with date and time information is one of the most basic skills every PHP programmer should get under their belt as soon as possible, so this is where we will be kicking off.

PHP represents time as the number of seconds that have passed since January 1st 1970 00:00:00 GMT, a date known as the start of the Unix epoch, hence this date format is known as "epoch time" or a "Unix timestamp". This might seem like a peculiar way to store dates, but it is actually remarkably good - internally you can store any date since 1970 as an integer, and convert to a human-readable string wherever necessary.



<< 4.4 Controlling script execution: exit(), eval(), and die()   4.5.1 Reading the current time: time() and microtime() >>
Table of Contents
Top-right shadow
 
Bottom-left shadow Bottom shadow