<html>
<head>
<title>DateFormatter class (nbui@wanadoo.fr)</title>
<style type="text/css">
<!--
TD.header {
font-family: Verdana; font-size: 12px; font-weight: bold
}
TD.title {
font-family: Verdana; font-size: 11px; font-weight: bold
}
TD.result {
font-family: Verdana; font-size: 10px; font-weight: bold; color: #006600
}
//-->
</style>
</head>
<body>
<?php
/*****************************************\
* Using the DateFormatter class *
\*****************************************/
// including class
require "class.dateformatter.php";
// init
$dateFormatter = new DateFormater();
// getting the current time
$currentTimeSecond = time();
?>
<table cellpadding=4 cellspacing=1 border=0 bgcolor=#cdcdcd width=600>
<tr>
<td bgcolor=#efefef class='header' colspan=2>DateFormatter : test example</td>
</tr>
<tr>
<td bgcolor=#ffffff class='title'>· time()</td>
<td bgcolor=#ffffff class='result'><?php echo $currentTimeSecond;?></td>
</tr>
<tr>
<td bgcolor=#ffffff class='title'>· date using php : <font color=#ff0000>Y.m.d \a\t H:i:s</font></td>
<td bgcolor=#ffffff class='result'><?php echo $dateFormatter->formatDate("Y.m.d \\a\\t H:i:s", $currentTimeSecond)?></td>
</tr>
<tr>
<td bgcolor=#ffffff class='title'>· date using java : <font color=#ff0000>yyyy.MM.dd 'at' HH:mm:ss</font></td>
<td bgcolor=#ffffff class='result'><?php echo $dateFormatter->formatDate("yyyy.MM.dd 'at' HH:mm:ss", $currentTimeSecond, TRUE)?></td>
</tr>
<tr>
<td bgcolor=#ffffff class='title'>· date using php : <font color=#ff0000>l, d F, Y</font></td>
<td bgcolor=#ffffff class='result'><?php echo $dateFormatter->formatDate("l, d F, Y (H:i)", $currentTimeSecond)?></td>
</tr>
<tr>
<td bgcolor=#ffffff class='title'>· date using java : <font color=#ff0000>EEEE, dd MMMM, yyyyy</font></td>
<td bgcolor=#ffffff class='result'><?php echo $dateFormatter->formatDate("EEEE, dd MMMM, yyyyy (HH:mm)", $currentTimeSecond, TRUE)?></td>
</tr>
</table>
</body>
</html>
|