The help for dates does explain how to do this.
gen mydate = date(mystr, "MDY")
format mydate %whatever
Note that you don't override the original.
Nick
On Thu, Nov 29, 2012 at 3:23 PM, Whitney Cox <wcox@parchment.com> wrote:
> I have a Stata .dta file that contains a date in a str10 data type field
> with the format of %10s that displays a date as 01/31/2012
> I want to convert it to an integer data type with the format
> %tdNN/DD/CCYY, which displays as 01/31/2012
>
> What should my command be to do that?
*
* 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/