php - IntlDateFormatter::parse doesn't work? -
i'm trying parse date , wrong timestamp
<?php // php version 5.5.9 // intl version 1.1.0 // icu version 52.1 // icu data version 52.1 // i'm in europe/moscow (gmt +3) echo date_default_timezone_get().php_eol; $df = \intldateformatter::create( 'en_en', intldateformatter::medium, intldateformatter::none, 'europe/moscow' // gmt +3 ); $timestamp = $df->parse('jun 19, 2015'); // 1434657600 - wrong timestamp! 1 hour? must 1434657600 + 3600 = 1434661200 echo $timestamp.php_eol; $dt = new \datetime(); $dt->settimestamp($timestamp); // thu, 18 jun 2015 23:00:00 +0300 - wrong, must thu, 19 jun 2015 00:00:00 +0300 echo $dt->format('r').php_eol; // or using date(): // echo date('r', $tm).php_eol;
solved updating icu repository https://launchpad.net/~rzz/+archive/ubuntu/icu
Comments
Post a Comment