Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: date


From   Enzo Coviello <enzo.coviello@tin.it>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: date
Date   Wed, 17 Sep 2003 16:51:54 +0200

At 16.18 17/09/03 +0200, you wrote:
how do i get the date (year only) from a string variable that look like dd/mm/yyyy.

thanks in advance.

gen str4 year = substr(datevar,7, .)

Enzo


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index