How old am I?

You want to express an age in years given the dob (mm/dd/yyyy) and today's date.



[!]Separate year in the format mm/dd/YYY into component parts [/!]

[math show=f]birthdatemonth=[getchars

[math show=f]birthdateday=[getchars

[math show=f]birthdateyear=[getchars start=7][dob][/getchars][/math]

[showif [date %m]>[birthDateMonth]]
[math show=f]age=[date %Y]-[birthDateYear][/math]
[showif [date %m]<[birthDateMonth]]
[math show=f]age=([date %Y]-[birthDateYear])-1[/math]
[showif [date %m]=[birthDateMonth]]
[showif [date %d]=[birthDateDay]]
[math show=f]age=[date %Y]-[birthDateYear][/math]
[showif [date %d]>[birthDateDay]]
[math show=f]age=[date %Y]-[birthDateYear][/math]
[showif [date %d]<[birthDateDay]]
[math show=f]age=([date %Y]-[birthDateYear])-1[/math]


Top Articles:

Download WebDNA Applications

WebDNA applications...

WebDNA reference

A list of all WebDNA instructions...

Technical Change History

This Technical Change History provides a reverse chronological list of WebDNA changes...


A compilation of some user's questions...

Tips and Tricks

A list of user-submitted tips ...

WebDNA Modules

A list of the currently available modules...

Related Readings:

Redefining [date] & [time] to match your time zone

Your server is not always in the same time zone as your web site...

Paypal IPN


How many working days?

This small script finds the number of working days between two dates...

Setting a 30-minute Cookie

Configuring the expires time for a short-term cookie is tricky...

Find duplicate records

Find duplicate records and do something with them...

Do you hate updating the copyright notice at the bottom of all your pages?

It's January 1st and you have to update the copyright notice at the bottom of all your websites...