Statalist


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

st: AW: Converting date strings into dates


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: Converting date strings into dates
Date   Mon, 15 Feb 2010 16:17:12 +0100

<> 



*************
clear*

input  str10 stringdate
1999Jan 
1999Feb 
end

gen double date=monthly(stringdate , "YM")
format date %tmMonth_CCYY
l
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von DE SOUZA Eric
Gesendet: Montag, 15. Februar 2010 15:47
An: Statalist
Betreff: st: Converting date strings into dates

I have never quite mastered the technique of converting date strings into
dates.
In this case, I have a string variable of the form: 1999Jan 1999Feb and so
on, and wish to convert it into a date
Thanks for any help.

Eric

Eric de Souza
College of Europe
Dyver 11
BE-8000 Brugge (Bruges)
Belgium



*
*   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   |   What's new   |   Site index