mirror of
https://github.com/php/php-src.git
synced 2024-10-02 15:26:06 +00:00
e9351b89a9
I don't think the current ICU API allows this bug to be completely fixed. Right now, the code cannot control the time zone used in date/time formats that appear inside complex subformats. See the comment inside umsg_set_timezone().
34 lines
832 B
PHP
34 lines
832 B
PHP
--TEST--
|
|
Bug #58756: w.r.t MessageFormatter
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('intl'))
|
|
die('skip intl extension not enabled');
|
|
--FILE--
|
|
<?php
|
|
ini_set("intl.error_level", E_WARNING);
|
|
//ini_set("intl.default_locale", "nl");
|
|
|
|
$time = 1247013673;
|
|
|
|
ini_set('date.timezone', 'America/New_York');
|
|
|
|
$msgf = new MessageFormatter('en_US', '{0,date,full} {0,time,h:m:s a V}');
|
|
|
|
echo "date: " . date('l, F j, Y g:i:s A T', $time) . "\n";
|
|
echo "msgf: " . $msgf->format(array($time)) . "\n";
|
|
|
|
//NOT FIXED:
|
|
/*$msgf = new MessageFormatter('en_US',
|
|
'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}');
|
|
|
|
echo "msgf2: ", $msgf->format(array($time, 'date')), " ",
|
|
$msgf->format(array($time, 'time')), "\n";
|
|
*/
|
|
|
|
?>
|
|
==DONE==
|
|
--EXPECT--
|
|
date: Tuesday, July 7, 2009 8:41:13 PM EDT
|
|
msgf: Tuesday, July 7, 2009 8:41:13 PM EDT
|
|
==DONE==
|