date_age - Lasso 8 Custom Tag Returns Age in Years

The project date_age and its source files are hosted on GitHub.

Description

[date_age] returns age in years. By default the current date is used to determine age, but can be overridden by passing in a second date.

Demo

Demo.

Usage

1
2
3
date_age(-dob=date('2000-02-29'));
'<br />';
date_age(-dob=date('2000-02-28'), -end=date('2010-03-01'));
1
2
3
=>
10
10

Installation

Instructions for installing date_age are in the demo file date_age_demo/index.lasso.

Did you like this article? Please send me a Gratipay, as little as 25¢ per week!

Updates, suggestions and comments regarding this article may be sent to Steve Piercy, [email protected] or comment using Disqus.


Written by Steve Piercy in Lasso on Wed, Oct 5, 2011.
Last modified: Tue, Jun 3, 2014
Tags: date_age, Lasso, date, age, years

Comments

comments powered by Disqus