[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: STRING to DATE
As you are realising, Stata needs to know the century,
20th, but your syntax is incorrect.
date(dxday, "dmy", 2050)
> -----Original Message-----
> From: firstname.lastname@example.org
> [mailto:email@example.com]On Behalf Of
> Thomas Speidel
> Sent: 08 March 2004 17:53
> To: firstname.lastname@example.org
> Subject: st: STRING to DATE
> I am trying to convert a string variable containing dates into a date
> variable using the DATE command.
> The dates in the string variable "dxday" are in the following format:
> I used the following command:
> . generate dxday2=date(dxday, "DM19Y")
> (50 missing values generated)
> Obviously, it did not work...
> Does anyone know if there is an easy way to format this type of date
> I guess the other way is to modify the data file directly to eliminate
> the dashes, but I wonder if there is a more elegant mehod.
* For searches and help try: