Autrefois, système de mesure pour les phases lunaires, il devient par la suite un instrument de
mesure pour s'immortalisé avec les empereurs romains Jules César et Auguste, il s'agit bien sure
du calendrier.
Bien qu'à l'origine on utilisait un calendrier Julien,
on utilise maintenant le calendrier grégorien.
A l'aide du code source PHP suivant, vous trouverez un calendrier grégorien correspondant à la réponse que vous souhaitez :
- <style>
- .calendarCell {
- border: 1px solid #000000;
- width: 100px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 14px;
- text-align: left;
- padding: 0px;
- margin: 0px;
- }
- </style>
- <?php
- function IsLeapYear($Year) {
- return ((($Year & 3) == 0) && (($Year % 100 != 0) || ($Year % 400 == 0)));
- }
-
- function DateToDayOfWeek($Y,$M,$D) {
- if(($M > 12) || (0 == $M) || (0 == $D)) {
- return 0;
- }
- if($Y < 0) {
- $Y++;
- }
- $T0 = intval(0.6 + 1 / $M);
- $T1 = $M + 12 * $T0;
- $T2 = $Y - $T0;
- $Total = intval(13 * ($T1 + 1) / 5) + intval(5 * $T2 / 4) - intval($T2 / 100) + intval($T2 / 400) + $D - 1;
- return $Total - 7 * intval($Total / 7);
- }
-
- function PutCalendar($Year,$Month) {
- $Days = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
- if(IsLeapYear($Year)) {
- $Days[2] = 29;
- }
- $D = DateToDayOfWeek($Year, $Month, 1);
- echo "<table>";
- echo '<tr style="background-color: #87b474;">'.
- '<td class="calendarCell">Dimanche</td>'.
- '<td class="calendarCell">Lundi</td>'.
- '<td class="calendarCell">Mardi</td>'.
- '<td class="calendarCell">Mercredi</td>'.
- '<td class="calendarCell">Jeudi</td>'.
- '<td class="calendarCell">Vendredi</td>'.
- '<td class="calendarCell">Samedi</td>'.
- "</tr>";
- echo str_repeat("<td></td>",$D);
- for($I = 1;$I <= $Days[$Month]; $I++) {
- print '<td class="calendarCell">'.$I."</td>";
- if(0 == ($D + $I) % 7) {
- print "</tr><tr>";
- }
- }
- echo "</table>";
- }
-
- function MonthName($Month) {
- if($Month == 1) {
- return "Janvier";
- } elseif($Month == 2) {
- return "Février";
- } elseif($Month == 3) {
- return "Mars";
- } elseif($Month == 4) {
- return "Avril";
- } elseif($Month == 5) {
- return "Mai";
- } elseif($Month == 6) {
- return "Juin";
- } elseif($Month == 7) {
- return "Juillet";
- } elseif($Month == 8) {
- return "Août";
- } elseif($Month == 9) {
- return "Septembre";
- } elseif($Month == 10) {
- return "Octobre";
- } elseif($Month == 11) {
- return "Novembre";
- } elseif($Month == 12) {
- return "Décembre";
- }
- return "";
- }
-
- for($I = 1; $I <= 12; $I++) {
- echo MonthName($I)." 2008n";
- PutCalendar(2008, $I);
- }
- ?>
on obtiendra le résultat suivant :
Janvier 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | 11 | 12 | | 13 | 14 | 15 | 16 | 17 | 18 | 19 | | 20 | 21 | 22 | 23 | 24 | 25 | 26 | | 27 | 28 | 29 | 30 | 31 | Février 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | | | | | 1 | 2 | | 3 | 4 | 5 | 6 | 7 | 8 | 9 | | 10 | 11 | 12 | 13 | 14 | 15 | 16 | | 17 | 18 | 19 | 20 | 21 | 22 | 23 | | 24 | 25 | 26 | 27 | 28 | 29 | Mars 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | | | | | | 1 | | 2 | 3 | 4 | 5 | 6 | 7 | 8 | | 9 | 10 | 11 | 12 | 13 | 14 | 15 | | 16 | 17 | 18 | 19 | 20 | 21 | 22 | | 23 | 24 | 25 | 26 | 27 | 28 | 29 | | 30 | 31 | Avril 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | 11 | 12 | | 13 | 14 | 15 | 16 | 17 | 18 | 19 | | 20 | 21 | 22 | 23 | 24 | 25 | 26 | | 27 | 28 | 29 | 30 | Mai 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | | | | 1 | 2 | 3 | | 4 | 5 | 6 | 7 | 8 | 9 | 10 | | 11 | 12 | 13 | 14 | 15 | 16 | 17 | | 18 | 19 | 20 | 21 | 22 | 23 | 24 | | 25 | 26 | 27 | 28 | 29 | 30 | 31 | |
Juin 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | 1 | 2 | 3 | 4 | 5 | 6 | 7 | | 8 | 9 | 10 | 11 | 12 | 13 | 14 | | 15 | 16 | 17 | 18 | 19 | 20 | 21 | | 22 | 23 | 24 | 25 | 26 | 27 | 28 | | 29 | 30 | Juillet 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | 11 | 12 | | 13 | 14 | 15 | 16 | 17 | 18 | 19 | | 20 | 21 | 22 | 23 | 24 | 25 | 26 | | 27 | 28 | 29 | 30 | 31 | Août 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | | | | | 1 | 2 | | 3 | 4 | 5 | 6 | 7 | 8 | 9 | | 10 | 11 | 12 | 13 | 14 | 15 | 16 | | 17 | 18 | 19 | 20 | 21 | 22 | 23 | | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | 31 | Septembre 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 14 | 15 | 16 | 17 | 18 | 19 | 20 | | 21 | 22 | 23 | 24 | 25 | 26 | 27 | | 28 | 29 | 30 | Octobre 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | | | 1 | 2 | 3 | 4 | | 5 | 6 | 7 | 8 | 9 | 10 | 11 | | 12 | 13 | 14 | 15 | 16 | 17 | 18 | | 19 | 20 | 21 | 22 | 23 | 24 | 25 | | 26 | 27 | 28 | 29 | 30 | 31 | Novembre 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | | | | | | 1 | | 2 | 3 | 4 | 5 | 6 | 7 | 8 | | 9 | 10 | 11 | 12 | 13 | 14 | 15 | | 16 | 17 | 18 | 19 | 20 | 21 | 22 | | 23 | 24 | 25 | 26 | 27 | 28 | 29 | | 30 | Décembre 2008
| Dimanche | Lundi | Mardi | Mercredi | Jeudi | Vendredi | Samedi | | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 14 | 15 | 16 | 17 | 18 | 19 | 20 | | 21 | 22 | 23 | 24 | 25 | 26 | 27 | | 28 | 29 | 30 | 31 |
|
Voir également
Système - Calendrier - Grégorien
Dernière mise à jour : Mardi, le 20 octobre 2009