How old am I?

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

numero = 45
interpreted = N
texte =
[date][text]dob=04/24/1964[/text][!]Separate year in the format mm/dd/YYY into component parts [/!][math show=f]birthdatemonth=[getchars start=1&end=2][dob][/getchars][/math]
[math show=f]birthdateday=[getchars start=4&end=5][dob][/getchars][/math]
[math show=f]birthdateyear=[getchars start=7][dob][/getchars][/math]
[showif [date %m]>[birthDateMonth]] [math show=f]age=[date %Y]-[birthDateYear][/math] [/showif] [showif [date %m]<[birthDateMonth]] [math show=f]age=([date %Y]-[birthDateYear])-1[/math] [/showif] [showif [date %m]=[birthDateMonth]] [showif [date %d]=[birthDateDay]] [math show=f]age=[date %Y]-[birthDateYear][/math] [/showif] [showif [date %d]>[birthDateDay]] [math show=f]age=[date %Y]-[birthDateYear][/math] [/showif] [showif [date %d]<[birthDateDay]] [math show=f]age=([date %Y]-[birthDateYear])-1[/math] [/showif] [/showif] [age]
[date]

[text]dob=04/24/1964[/text]

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

[math show=f]birthdatemonth=[getchars
start=1&end=2][dob][/getchars][/math]

[math show=f]birthdateday=[getchars
start=4&end=5][dob][/getchars][/math]

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


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

DOWNLOAD WEBDNA NOW!

Top Articles:

AWS Raw WebDNA LAMP-Plus WebServer

Amazon Web Services (AWS) README for Machine Image ID...

WebDNA Modules

A list of the currently available modules...

WebDNA Libraries

A list of available libraries for WebDNA...

Tips and Tricks

A list of user-submitted tips ...

[biotype]

BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...

Technical Change History

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

Related Readings:

Setting a 30-minute Cookie

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

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...

reCAPTCHA code

reCAPTCHA helps prevent automated abuse of your site (such as comment spam or bogus registrations) by using a CAPTCHA to ensure that only humans perform certain actions...

Spaghetti code

How to get rid of very long search strings...

Annoying character on writefile

How do I get rid of or convert the line feed character during a writefile?...

Export data to Excel

Here's a handy way to export your data to a text or Excel file...