This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Dreamweaver > August 2004 > hey Mick, have something for this?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
hey Mick, have something for this?
|
|
| primostudent 2004-08-24, 7:14 am |
| Like to set up a little - counter.
Enter date of birth, it kicks back number of days on this rock.
Difficult to add hr/min/sec too?
And how about separate field for date in future...
Thanks
| |
| Mick White 2004-08-26, 12:18 pm |
| function daysSince(aDateObj){
return Math.floor((new Date()-new Date(aDateObj))/(1000*60*60*24))
}
The trick is to have the user enter his dob in a predefined format.
mm/dd/yyyy, will work for most of the world's computers.
alert(daysSince("1/2/1980"))
<form>
<input type="text" onchange="t.value=daysSince(this.value)"?><p> enter
dob in the format mm/dd/yyyy </p>
<input type="text" name="t">
</form>
Mick
primostudent wrote:
> Like to set up a little - counter.
>
> Enter date of birth, it kicks back number of days on this rock.
>
> Difficult to add hr/min/sec too?
>
>
> And how about separate field for date in future...
>
>
> Thanks
>
|
|
|
| | Copyright 2003 - 2009 forum4designers.com Software forum Computer Hardware reviews |
|