TIME ZONE CONVERSION USING PHP DATETIME CLASS

Following on from my post last month about problems with PEAR daylight saving, here’s a quick example of using the PHP DateTime Class which was introduced recently (PHP 5.2). Convert from UTC to Europe/London local time: $time_object = new DateTime(’2011-04-19 … Continue reading

PEAR DATE DAYLIGHT SAVING BUGS

The clocks went forward in the UK last night and fortunately I was working on a site today which involved manipulating dates and times between timezones so I immediately noticed a problem in PEAR Date that I have been using … Continue reading

UK DATES AND STRTOTIME

In PHP, strtotime cannot parse the UK date format (i.e. 30/02/2011) as there’s no 30th month. Here’s a quick fix I came across that seems to work for me (so far)… Just replace the “/” with a “-” before parsing … Continue reading