Time: page 1
Add a duration or interval to a date
In PHP you can easily add a duration to a DateTime instance in a number of ways. I will review the most common methods for completing the task starting with those available on the DateTime object itself. If you are running PHP 5.2 then the only way to achieve this is to call the modify method. This allows you to pass in a date format, but in this case we are most interested in the relative formats. Read more ⇒
Convert UTC/GMT or any time zone to local time in PHP
Wrangling dates and times can be a somewhat arduous task for all programmers. One very common requirement is to convert a time from one time zone to another. In PHP this is greatly simplified with the DateTime standard library classes and especially DateTimeZone. For this example let us assume we have a UTC date and time string (2011-04-27 02:45) that we would like to convert to ACST (Australian Central Standard Time). Read more ⇒