The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
Now I'm on to the personal part of my site, which is a single page about me. The rest may be revealed later.
So anyway, what I want is a simple javascript which calculates my age in years. I'm thinking along the lines of my year of birth being set in a variable, even though that variable will not change, and a simple mathematical equation which deducts my year of birth from the current year, resulting in my age.
Would anyone be able to do that for me?
Muchos danke, mes ami. :)
Or have you sorted this problem already for me so that I just set the month to 10?
[S][S]I'll discover your real identity one day Garin. Just you wait![/S][/S]
Nice code by the way *tempted*
<script language="JavaScript" type="text/javascript">
var BirthDay=13;
var BirthMonth=6;
var BirthYear=1980;
var now=new Date();
var CurrDay=now.getDate();
var CurrMonth=now.getMonth()+1;
var CurrYear=now.getFullYear();
var MyAge=CurrYear-BirthYear-1;
if ((BirthMonth<CurrMonth) || ((BirthMonth==CurrMonth) && (BirthDay<=CurrDay))) {
MyAge++;
}
document.write('My Age is '+MyAge);
</script>I suppose you can guess to change the 3 variables at the top with your own birthday.
Now I'm on to the personal part of my site, which is a single page about me. The rest may be revealed later.
So anyway, what I want is a simple javascript which calculates my age in years. I'm thinking along the lines of my year of birth being set in a variable, even though that variable will not change, and a simple mathematical equation which deducts my year of birth from the current year, resulting in my age.
Would anyone be able to do that for me?
Muchos danke, mes ami. :)