php-src/ext/intl/tests/bug58756_MessageFormatter.phpt
Gustavo André dos Santos Lopes e9351b89a9 Bug #58756: w.r.t MessageFormatter (partial fix)
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().
2012-05-17 17:57:01 +02:00

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==