laloi Liberté, Egalité, Fraternité Profil : Habitué(e) | Sur mon site, j'utilise celui-là:
Code :
- <HEAD>
- <script type="text/javascript">
- Maintenant = new Date();
- TempMaintenant = Maintenant.getTime();
- JourAnniv = 30;
- MoisAnniv = 2; //0:janvier, 1:fevrier, ..., 11:decembre
- if (Maintenant.getMonth()>MoisAnniv) { // après MoisAnniv
- Annee = Maintenant.getFullYear()+1;
- }
- else {
- if (Maintenant.getMonth()<MoisAnniv) { //avant MoisAnniv
- Annee = Maintenant.getFullYear();
- }
- else { // pendant MoisAnniv
- if (Maintenant.getDate()>JourAnniv) { // après
- Annee = Maintenant.getFullYear()+1;
- }
- else { // avant
- Annee = Maintenant.getFullYear();
- }
- }
- }
- Future = new Date(Annee, MoisAnniv, JourAnniv,Maintenant.getHours(),Maintenant.getMinutes(),Maintenant.getSeconds(),Maintenant.getMilliseconds());
- TempFuture = Future.getTime();
- DiffSec = Math.floor((TempFuture-TempMaintenant)/1000);
- DiffMin = Math.floor(DiffSec/60);
- Diffheure = Math.floor(DiffMin/60);
- DiffJour = Math.floor(Diffheure/24);
- DiffMin = DiffMin%60;
- Diffheure = Diffheure%24;
- DiffSec = DiffSec%60;
- </SCRIPT>
- </HEAD>
|
Code :
- <BODY>
- <script type="text/javascript">
- document.write('<FONT COLOR="#AAAAFF" SIZE=4>Mon anniversaire, c\'est ');
- if (DiffJour == 0)
- {
- document.write('<B><FONT COLOR="#FF6F6F">AUJOURD\'HUI !!</FONT></B><br/> Alors j\'espère que tu as pensé à mon cadeau !!</FONT><FONT COLOR="#FFFF00"><I> LOL</I></FONT>');
- }
- else {
- document.write('dans <B><FONT COLOR="#FF6F6F">' + DiffJour + ' jour(s)</FONT></B><br/> Alors pensez dès maintenant à mon cadeau !!</FONT><FONT COLOR="#FFFF00"><I> LOL</I></FONT>');
- }
- </SCRIPT>
- </BODY>
| ---------------
Aidez-vous les uns les autres comme je vous ai aidé (cad autant que j'ai pu) ;-)
|