From ab4e3fbf86c38014542b53744057932a32bf5a7f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 19 Feb 2013 19:42:59 +0100 Subject: [PATCH] fixed time parsing when the composer.lock file has an old time format --- src/Composer/Package/Loader/ArrayLoader.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Package/Loader/ArrayLoader.php b/src/Composer/Package/Loader/ArrayLoader.php index a5464bd00..eb7345bf8 100644 --- a/src/Composer/Package/Loader/ArrayLoader.php +++ b/src/Composer/Package/Loader/ArrayLoader.php @@ -135,8 +135,10 @@ class ArrayLoader implements LoaderInterface } if (!empty($config['time'])) { + $time = ctype_digit($config['time']) ? '@'.$config['time'] : $config['time']; + try { - $date = new \DateTime($config['time'], new \DateTimeZone('UTC')); + $date = new \DateTime($time, new \DateTimeZone('UTC')); $package->setReleaseDate($date); } catch (\Exception $e) { }