[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: date format

From   Alexandra Griffiths <>
Subject   st: Re: date format
Date   Thu, 25 Oct 2007 15:33:30 +0100


Just use:

gen datenew=date( dateold, "YMD")
format datenew %td

If your date variable is not a string variable then run this (below) first to convert it to a string:

tostring datesold, replace

Hope this helps,


Rodriguez, Dan (Prop) wrote:

Need to convert date format of YYYYMMDD into Stata date format. Does anyone have a short do-file to accomplish this?

Thank you,
*   For searches and help try:

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