Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

# Re: st: how to get age in number of years, months and days

 From Nick Cox To statalist@hsphsun2.harvard.edu Subject Re: st: how to get age in number of years, months and days Date Fri, 19 Oct 2012 00:21:36 +0100

```I am not aware that you are missing something. My guess is that this
is too awkward to be usable and too fiddly to be an amusing
programming problem.

In particular, it doesn't sound an easy thing to work with given that
months are of unequal length. Even years and days sounds a little
tricky.

Most people seem satisfied with the difference in dates divided by
365.25. I've often seen one-liners giving that.

To spell out the obvious, you'd need to treat leap years carefully and
in particular anyone born on 29 February.

There should be a few such people on this list; what do you/they do?
Celebrate on 28 Feb or 1 March?

There is discussion of leap years at

FAQ     . . . . . . . . . . . . . . . . . . . . . . . . . Leap year indicators
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
1/04    How do I identify leap years in Stata?
http://www.stata.com/support/faqs/data/leapyear.html

Nick

On Thu, Oct 18, 2012 at 11:10 PM, jose maria pacheco de souza
<jmpsouza@usp.br> wrote:

> is there any user writen program that presents the differences between two
> dates DMY (today date and birthday date, say) as number of years, months and
> days?
> I tried the help (all three searchs), the dates and times help  and the pdf
> manual. Maybe I am missing something.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index