Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: dates


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: dates
Date   Tue, 1 Apr 2003 16:48:50 +0100

Vania Gerova

> I have a string variable containing dates. Unfortunately
> the dates are in
> different formats. One of the formats is a datevalue, like
> 33824, which
> seems to represent  08/08/1992, i.e. dd/mm/yyyy   (European
> format).

. di mdy(8,8,1992) - mdy(1,1,1900)
33822

I have read that there is a bug regarding 29 Feb 1900, which
didn't happen, but did according to some software. I don't know
if that helps or not.

> The other type is an American date format, i.e. m/dd/yyyy
(5/25/1995).
> So the variable looks like:

Use

. di date("5/25/1995", "mdy")
12928

Nick
[email protected]

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index