Source for file I18N_DateTime.php
Documentation is available at I18N_DateTime.php
//ini_set('include_path',realpath(dirname(__FILE__).'/../../../').':'.realpath(dirname(__FILE__).'/../../../../includes').':'.ini_get('include_path'));
//ini_set('error_reporting',E_ALL);
print "You can set the locale by giving a GET-param i.e. '?lang=fr_FR'<br><br>";
require_once 'I18N/DateTime.php';
if (@$_REQUEST['lang']) {
$lang = $_REQUEST['lang'];
echo 'require_once \'I18N/DateTime.php\';<br>';
echo '$dateTime = new I18N_DateTime( \''. $lang. '\' );<br><br>';
// very simple examples, to get the date and/or time for now
myPrint('<h1>simple Examples</h1>');
// get the time now in format DEFAULT
myPrint( '$dateTime->format() . . . '. $dateTime->format () );
myPrint( '$dateTime->formatShort() . . . '. $dateTime->formatShort () );
myPrint( '$dateTime->formatMedium() . . . '. $dateTime->formatMedium () );
myPrint( '$dateTime->formatLong() . . . '. $dateTime->formatLong () );
myPrint( '$dateTime->formatFull() . . . '. $dateTime->formatFull () );
myPrint( '$dateTime->formatTime() . . . '. $dateTime->formatTime () );
myPrint( '$dateTime->formatTimeShort() . . . '. $dateTime->formatTimeShort () );
myPrint( '$dateTime->formatTimeMedium() . . . '. $dateTime->formatTimeMedium () );
myPrint( '$dateTime->formatTimeLong() . . . '. $dateTime->formatTimeLong () );
myPrint( '$dateTime->formatTimeFull() . . . '. $dateTime->formatTimeFull () );
myPrint( '$dateTime->formatDate() . . . '. $dateTime->formatDate () );
myPrint( '$dateTime->formatDateShort() . . . '. $dateTime->formatDateShort () );
myPrint( '$dateTime->formatDateMedium() . . . '. $dateTime->formatDateMedium () );
myPrint( '$dateTime->formatDateLong() . . . '. $dateTime->formatDateLong () );
myPrint( '$dateTime->formatDateFull() . . . '. $dateTime->formatDateFull () );
////////////////////////////////////////////
// get the time now in format DEFAULT
// get the time now in format FULL
////////////////////////////////////////////
// get the time now in format DEFAULT
myPrint( $dateTime->formatDate () );
// get the time now in format FULL
myPrint( $dateTime->formatDate () );
////////////////////////////////////////////
// get the time now in format DEFAULT
myPrint( $dateTime->formatTime () );
// get the time now in format FULL
myPrint( $dateTime->formatTime () );
/*****************************
// get the time now in a custom format
$myFormat = $dateTime->setFormat ('l, d.m.Y - H:i:s \y\e\a\h');
// switch back to default format
// switch back to myFormat
$dateTime->setFormat ( $myFormat );
myPrint( $dateTime->formatDate () );
myPrint('<h1>CUSTOM time-format</h1>');
// set custom time format only
$myTimeFormat = $dateTime->setTimeFormat ('H \U\h\r i \M\i\n\u\t\e\n \u\n\d s \S\e\k\u\n\d\e\n');
myPrint( $dateTime->formatTime () );
// switch back to default format
// switch back to myFormat
$dateTime->setFormat ( $myTimeFormat );
myPrint( $dateTime->formatTime () );
Documentation generated on Mon, 11 Mar 2019 15:36:11 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|