54 lines
No EOL
1.7 KiB
PHP
54 lines
No EOL
1.7 KiB
PHP
<?php
|
|
header('Content-type: text/html; charset=utf-8');
|
|
require __DIR__ . '/date.inc';
|
|
|
|
$formatter = new DateFormatter();
|
|
?><!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style type="text/css">
|
|
.fullpage {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
.fullpage iframe {
|
|
width: 90%;
|
|
height: 80em;
|
|
}
|
|
input[type="text"] {
|
|
width: 20em;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<table class="fullpage">
|
|
<tr>
|
|
<td valign="top" width="40%">
|
|
<h1>Date helper</h1>
|
|
<p>Saisissez une chaine de format de date PHP dans le champ ci-dessous,
|
|
et le site vous renverra la date courante sous le format indiqué.</p>
|
|
<p>Le cadre à droite contient la documentation de référence de la
|
|
fonction PHP date().</p>
|
|
<form method="POST">
|
|
<table>
|
|
<tr>
|
|
<td><label for="format">Format:</label></td>
|
|
<td><input type="text" name="format" value="<?php echo $formatter->format; ?>" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="result">Résultat:</label></td>
|
|
<td><input disabled="disabled" type="text" name="result" value="<?php echo $formatter->date(); ?>" /></td>
|
|
</tr>
|
|
</table>
|
|
<input type="submit" name="apply" value="Formater" />
|
|
<input type="submit" name="reset" value="Valeur par défaut" />
|
|
</form>
|
|
</td>
|
|
<td valign="top">
|
|
<iframe
|
|
src="http://fr2.php.net/manual/fr/function.date.php#refsect1-function.date-parameters" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|