SchreibMalWas

Wie alt bist du?

"Mit Javascript ist es möglich, die verschiedensten Dinge zu berechnen und zu erstellen. Im folgenden können Sie einfach Ihr Geburtsdatum (Jahr 4-stellig) eingeben und das Script berechnet dann auf die Sekunde genau ihr jetziges Alter.
Ihre persönlichen Daten werden nur für die Rechnung verwendet und nicht von uns gespeichert!
Voreinstellung ist 01.01.1900, Mitternacht.
Der Javascript code für dieses Programm befindet sich unten auf der Seite. Sie dürfen diesen gerne auch auf Ihrer Webseite weiter verwenden.

Vorschau:
  • .
Ich wurde geboren am...

Jahr Monat Tag
Stunde Minute Sekunde
 
  • .
Ich bin...
...Jahre alt
  • .
oder..
...Tage alt
  • .
oder..
...Stunden alt
  • .
oder..
...Minuten alt
  • .
oder..
...Sekunden alt
exakt normal

Qavascript-Quellcode:
<script language="JavaScript">
<!--
var acc=2
var show_time=false;
var timerID=null;
var blank=":";
function stop() {
if (show_time)
clearTimeout(timerID);
document.my_age.date_time.value=" ";
show_time=false;
}
function startc() {
var today=new Date();
if (acc == 2){
alert ("Bitte wählen Sie einen Berechnungsmodus: Exakt or Normal")
} else {
var acc1=acc;
var display_value =" Time: " + today.getHours()
if(today.getMinutes() < 10){
display_value+=":0" + today.getMinutes();
}else{display_value+=":" + today.getMinutes();
}if (today.getSeconds() < 10){display_value+=":0" + today.getSeconds();
}else{display_value+=":" + today.getSeconds();
}if(today.getHours()>=12) {
display_value+=" P.M. "
}else{display_value+=" A.M. "
}
display_value += " Date: "
+ (today.getMonth()+1) + "/"
+ today.getDate() + "/" + today.getFullYear();
document.my_age.date_time.value=display_value;
writeyourAge(acc1)
timerID=setTimeout("startc()",100);
show_time=true;
}
}
function writeyourAge(onval) {
if (onval == 0) {
normal()
} else {
accurate()
}
}
function normal() {
TheDate = new Date();
Month = TheDate.getMonth()+1;
Day = TheDate.getDate();
Year = TheDate.getFullYear();
Hour = TheDate.getHours();
Minute = TheDate.getMinutes();
Second = TheDate.getSeconds();
by = (document.my_age.birthy.value);
bm = (document.my_age.birthm.value);
bd = (document.my_age.birthd.value);
bh = (document.my_age.birthh.value);
bmn = (document.my_age.birthmin.value);
bs = (document.my_age.births.value);
BDate = Date.UTC(by,bm,bd,bh,bmn,bs);
if (Year<2000) {
CDate = Date.UTC(Year,Month,Day,Hour,Minute,Second);
} else {
CDate = Date.UTC(Year,Month,Day,Hour,Minute,Second);
}
Age = CDate-BDate;
document.my_age.yrs.value = parseInt(((((Age/1000)/60)/60)/24)/365.25,10);
document.my_age.dys.value = parseInt((((Age/1000)/60)/60)/24,10);
document.my_age.hrs.value = parseInt(((Age/1000)/60)/60,10);
document.my_age.mins.value = parseInt((Age/1000)/60,10);
document.my_age.secs.value = parseInt(Age/1000,10);
}
function accurate() {
TheDate = new Date();
Month = TheDate.getMonth()+1;
Day = TheDate.getDate();
Year = TheDate.getFullYear();
Hour = TheDate.getHours();
Minute = TheDate.getMinutes();
Second = TheDate.getSeconds();
by = (document.my_age.birthy.value);
bm = (document.my_age.birthm.value);
bd = (document.my_age.birthd.value);
bh = (document.my_age.birthh.value);
bmn = (document.my_age.birthmin.value);
bs = (document.my_age.births.value);
BDate = Date.UTC(by,bm,bd,bh,bmn,bs);
if (Year<2000) {
CDate = Date.UTC(Year,Month,Day,Hour,Minute,Second);
} else {
CDate = Date.UTC(Year,Month,Day,Hour,Minute,Second);
}
Age = CDate-BDate;
document.my_age.yrs.value = Math.round((((((Age/1000)/60)/60)/24)/365.25) * 100) / 100;
document.my_age.dys.value = Math.round(((((Age/1000)/60)/60)/24) * 100) / 100;
document.my_age.hrs.value = Math.round((((Age/1000)/60)/60) * 100) / 100;
document.my_age.mins.value = Math.round(((Age/1000)/60) * 100) / 100;
document.my_age.secs.value = Math.round((Age/1000) * 100) / 100;
}
//-->
</script>
<small><a href="http://schreibmalwas.de.tl/Wie-alt-bist-du-f-.htm" target="_blank">alters-berechner von schreibmalwas</a></small>
<form name="my_age">
    <table width="90%" cellspacing="0" cellpadding="2" border="0">
        <tbody>
            <tr>
                <td>
                <ul>
                    <li><font color="#FFFFFF">.</font></li>
                </ul>
                </td>
                <td><font class="stn">Ich wurde geboren am...</font></td>
                <td><center> <input type="button" onclick="startc()" value="" size="25" name="date_time" /><br />
                <font class="stn">Jahr</font><input type="text" size="4" name="birthy" /> <font class="stn">Monat</font><input type="text" size="2" name="birthm" /> <font class="stn">Tag</font><input type="text" size="2" name="birthd" /><br />
                <font class="stn">Stunde</font><input type="text" size="2" name="birthh" /> <font class="stn">Minute</font><input type="text" size="2" name="birthmin" /> <font class="stn">Sekunde</font><input type="text" size="2" name="births" /> </center></td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td width="2%">
                <ul>
                    <li><font color="black">.</font></li>
                </ul>
                </td>
                <td width="15%"><font class="stn">Ich bin...</font></td>
                <td><center><input type="text" size="20" name="yrs" /></center></td>
                <td width="22%"><font class="stn">...Jahre alt</font></td>
            </tr>
            <tr>
                <td>
                <ul>
                    <li><font color="black">.</font></li>
                </ul>
                </td>
                <td><font class="stn">oder..</font></td>
                <td><center><input type="text" size="20" name="dys" /></center></td>
                <td><font class="stn">...Tage alt</font></td>
            </tr>
            <tr>
                <td>
                <ul>
                    <li><font color="black">.</font></li>
                </ul>
                </td>
                <td><font class="stn">oder..</font></td>
                <td><center><input type="text" size="20" name="hrs" /></center></td>
                <td><font class="stn">...Stunden alt</font></td>
            </tr>
            <tr>
                <td>
                <ul>
                    <li><font color="black">.</font></li>
                </ul>
                </td>
                <td><font class="stn">oder..</font></td>
                <td><center><input type="text" size="20" name="mins" /></center></td>
                <td><font class="stn">...Minuten alt</font></td>
            </tr>
            <tr>
                <td>
                <ul>
                    <li><font color="black">.</font></li>
                </ul>
                </td>
                <td><font class="stn">oder..</font></td>
                <td><center><input type="text" size="20" name="secs" /></center></td>
                <td><font class="stn">...Sekunden alt</font></td>
            </tr>
        </tbody>
    </table>
    <table width="100%" cellspacing="0" cellpadding="20">
        <tbody>
            <tr>
                <td><center> <font class="stn">exakt</font><input type="radio" onclick="if (this.checked) {acc=1}" value="ON" name="accurate" /> <font class="stn">normal</font><input type="radio" onclick="if (this.checked) {acc=0}" value="OFF" name="accurate" /> <input type="button" onclick="startc()" value=" Start " name="norm" /> <input type="button" onclick="stop()" value=" Stop " name="norm" /> </center></td>
            </tr>
        </tbody>
    </table>
</form>
<script>
normal();
</script>






Kommentar zu dieser Seite hinzufügen:
Ihr Name:
Ihre Homepage:
Ihre Nachricht:

Sie sind der 28687 Besucher auf Schreibmalwas-homepagetools Statistiken
=> Willst du auch eine kostenlose Homepage? Dann klicke hier! <=
"