note 78570 added to ref.datetime

From: Date: Wed, 17 Oct 2007 19:42:41 +0000
Subject: note 78570 added to ref.datetime
Groups: php.notes 
Request: Send a blank email to php-notes+get-131462@lists.php.net to get a copy of this message
Not really elegant, but tells you, if your installed timezonedb is the most recent: class TestDateTimeTimezonedbVersion extends PHPUnit_Framework_TestCase { public function testTimezonedbIsMostRecent() { ini_set( 'date.timezone', 'Europe/Berlin' ); ob_start(); phpinfo(INFO_MODULES); $info = ob_get_contents(); ob_end_clean(); $start = strpos( $info, 'Timezone Database Version' ) + 29; $this->assertTrue( FALSE !== $start, 'Seems there is no timezone DB installed' ); $end = strpos( $info, "\n", $start ); $installedVersion = substr( $info, $start, $end - $start ); exec( 'pecl remote-info timezonedb', &$output ); $availableVersion = substr( $output[2], 12 ); $this->assertEquals( $availableVersion, $installedVersion, 'The installed timezonedb is not actual. Installed: '.$installedVersion .' available: '.$availableVersion ); } } ---- Server IP: 217.13.201.10 Probable Submitter: 80.139.204.127 ---- Manual Page -- http://www.php.net/manual/en/ref.datetime.php Edit -- https://master.php.net/note/edit/78570 Del: integrated -- https://master.php.net/note/delete/78570/integrated Del: useless -- https://master.php.net/note/delete/78570/useless Del: bad code -- https://master.php.net/note/delete/78570/bad+code Del: spam -- https://master.php.net/note/delete/78570/spam Del: non-english -- https://master.php.net/note/delete/78570/non-english Del: in docs -- https://master.php.net/note/delete/78570/in+docs Del: other reasons-- https://master.php.net/note/delete/78570 Reject -- https://master.php.net/note/reject/78570 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#131462) next »