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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: dates


From   Eric Booth <ebooth@ppri.tamu.edu>
To   "<statalist@hsphsun2.harvard.edu>" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: dates
Date   Tue, 14 Sep 2010 20:32:18 +0000

<>



******************!
clear
inp double(mydate)
01051987 
09151973 
12302005 
end
tostring mydate, replace force format(%08.0f) 
g mydate2 = date(mydate, "MDY")
format mydate2 %td
l mydate*

//or using the display format you described//
format mydate2 %tdMon_DD,_CCYY
******************!


~ Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
ebooth@ppri.tamu.edu
Office: +979.845.6754




On Sep 14, 2010, at 3:10 PM, Michael Eisenberg wrote:

> Colleagues,
> 
> I have a filed with dates listed as such
> 
> 01051987 which is Jan 5, 1987
> 09151973 which is Sept 15, 1973
> 12302005 which is Dec 30, 2005
> 
> How can I make stata automatically recognize that date format?
> 
> Thank you in advance.
> 
> Mike
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index