Skip to content

Instantly share code, notes, and snippets.

@micti
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micti/c5bceae922f0c03d5eb3 to your computer and use it in GitHub Desktop.
Save micti/c5bceae922f0c03d5eb3 to your computer and use it in GitHub Desktop.
Test script #69374 & #69398
<?php
$millitimestamp = 1428133423941.0; // 14:43:43 April 04 2015
$pattern1 = '\'tháng\' MM, y'; // yMM format for Vietnamese
$pattern2 = 'y년 MMM'; // yMM format for Korean
$date = IntlCalendar::createInstance('Asia/Ho_Chi_Minh');
$date->setTime($millitimestamp);
echo IntlDateFormatter::formatObject($date, $pattern1, 'vi_VN'), "\n";
echo IntlDateFormatter::formatObject ($date, $pattern2, 'ko_KR'), "\n";
?>
tháng 04, 2015
2015년 4월
<?php
$millitimestamp = 1428133423941.0; // 14:43:43 April 04 2015
$date = IntlCalendar::createInstance('Asia/Ho_Chi_Minh');
$date->setTime($millitimestamp);
echo IntlDateFormatter::formatObject($date, array(IntlDateFormatter::SHORT, IntlDateFormatter::NONE), 'vi_VN'), "\n";
echo IntlDateFormatter::formatObject ($date, array(IntlDateFormatter::SHORT, IntlDateFormatter::NONE), 'ko_KR'), "\n";
?>
04/04/2015
15. 4. 4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment