Subversion Repositories Applications.papyrus

Rev

Rev 1688 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1463 alexandre_ 1
<?php
2
 
3
/**
4
* Using I18Nv2_Locale
5
* ===================
6
*
7
* I18Nv2_Locale is a formatter object that provides functionality to format
8
* dates, times, numbers and currencies in locale dependent conventions.
9
*
10
* $Id: using_I18Nv2_Locale.php,v 1.1 2007-06-25 09:55:25 alexandre_tb Exp $
11
*/
12
 
13
require_once 'I18Nv2.php';
14
 
15
$locale = &I18Nv2::createLocale('de_AT');
16
 
17
echo "de_AT\n=====\n";
18
echo "Format a currency value of 2000: ",
19
    $locale->formatCurrency(2000, I18Nv2_CURRENCY_INTERNATIONAL), "\n";
20
 
21
echo "Format todays date:              ",
22
    $locale->formatDate(null, I18Nv2_DATETIME_FULL), "\n";
23
 
24
echo "Format current time:             ",
25
    $locale->formatTime(null, I18Nv2_DATETIME_SHORT), "\n";
26
 
27
 
28
$locale->setLocale('en_GB');
29
 
30
echo "\nen_GB\n=====\n";
31
echo "Format a currency value of 2000: ",
32
    $locale->formatCurrency(2000, I18Nv2_CURRENCY_INTERNATIONAL), "\n";
33
 
34
echo "Format todays date:              ",
35
    $locale->formatDate(null, I18Nv2_DATETIME_FULL), "\n";
36
 
37
echo "Format current time:             ",
38
    $locale->formatTime(null, I18Nv2_DATETIME_SHORT), "\n";
39
 
40
?>