Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: convert date in string data type to integer data type


From   Whitney Cox <wcox@parchment.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: convert date in string data type to integer data type
Date   Thu, 29 Nov 2012 08:23:51 -0700

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?

Thanks - Whit

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index