Remove some PHP 5.1 cruft (DateTime has existed since 5.2.0)
authorChad Horohoe <chadh@wikimedia.org>
Mon, 24 Sep 2012 14:03:30 +0000 (10:03 -0400)
committerChad Horohoe <chadh@wikimedia.org>
Mon, 24 Sep 2012 14:03:30 +0000 (10:03 -0400)
Change-Id: Id1fc9c874906dcc44abab5b557c8138e6b7ecc50

includes/Timestamp.php

index fed95c0..a5844b6 100644 (file)
@@ -140,14 +140,10 @@ class MWTimestamp {
                        $strtime = call_user_func_array( "sprintf", $da );
                }
 
-               if( function_exists( "date_create" ) ) {
-                       try {
-                               $final = new DateTime( $strtime, new DateTimeZone( 'GMT' ) );
-                       } catch(Exception $e) {
-                               throw new TimestampException( __METHOD__ . ' Invalid timestamp format.' );
-                       }
-               } else {
-                       $final = strtotime( $strtime );
+               try {
+                       $final = new DateTime( $strtime, new DateTimeZone( 'GMT' ) );
+               } catch(Exception $e) {
+                       throw new TimestampException( __METHOD__ . ' Invalid timestamp format.' );
                }
 
                if( $final === false ) {