Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: How to separate date variables


From   Tim Evans <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: How to separate date variables
Date   Fri, 8 Jun 2012 13:00:18 +0100

Have you tried something like:

g day = day(startdate)
g month = month(startdate)
g year = year(startdate)

Best wishes

Tim

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Benedito Cunguara
Sent: 08 June 2012 12:45
To: [email protected]
Subject: st: How to separate date variables

Dear colleagues,

I have a variable called startdate, formatted %td. Examples of
observations include 01jun2001. I am trying to creating three
variables correspondingly for day, month, and year. For the
observation above, day=1, month=6, and year=2001.

I am using STATA 11.2 IC.

Any help is welcome.

Many thanks,
Benedito

-- 
***
Benedito Cunguara, PhD
Dept. of Agricultural, Food, and Resource Economics
Michigan State University
I am based in Maputo, Mozambique.
Skype: cunguara
Tel. in Mozambique: cell: 258-82-4759690;  office: 258-21-462222
Website: http://www.aec.msu.edu/fs2/mozambique/index.htm
*
*   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/

_DISCLAIMER:
This email and any attachments hereto contains proprietary information, some or all of which may be confidential or legally privileged. It is for the exclusive use of the intended recipient(s) only. If an addressing or transmission error has misdirected this e-mail and you are not the intended recipient(s), please notify the author by replying to this e-mail. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this e-mail or any attachments, as this may be unlawful.


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