I'm having an issue trying to convert a Unix time (taken from an XML file generated by an SVN Info command) into to a formatted date/time.
The $svnInfoTime is correct, and the generated $unixTime reflects this, though the $formattedDate seems to be slightly out.
I've seen this occur in a number of (but not all) cases. An example:
<?php
$svnInfoTime = "2013-03-06T15:42:00.894378Z";
$unixTime = strtotime($svnInfoTime);
$formattedDate = date('d F, Y, h:i A', $unixTime);
echo "SVN info time : " . $svnInfoTime . "<br>";
echo "unix time : " . $unixTime . "<br>";
echo "formatted date: " . $formattedDate . "<br>";
>
outputs:
SVN info time : 2013-03-06T15:42:00.894378Z
unix time : 1362584520
formatted date: 06 March, 2013, 04:42 PM
Why is the formatted date displaying 4:42 pm, when the Unix time is 3:42 pm??
Can anyone tell me where I'm going wrong?
date_default_timezone_set('UTC');.