4.5 Working with Date and TimeThis 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.
|
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.
My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!
|