[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: Extract Year from String
<>
**************
di year(dofc(clock("Dec/17/1998 11:30:00 PM", "MDY hms")))
**************
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of [email protected]
Sent: Dienstag, 13. Oktober 2009 20:06
To: [email protected]
Subject: st: Extract Year from String
I need to extract year from a string variable (str24 %24s).
How can I extract, for example, 1998 from this observation:
Dec/17/1998 11:30:00 PM
Thank you.
*
* 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/