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]

st: ym() date function is acting strangely


From   Gabi Huiber <ghuiber@gmail.com>
To   The Statalist <statalist@hsphsun2.harvard.edu>
Subject   st: ym() date function is acting strangely
Date   Thu, 15 Dec 2011 13:34:00 -0800

I do this:

clear
set obs 10
gen year=2010
gen month=_n
gen date1=ym(year, month)
format date1 %tm

And I get this:

year	month	date1
2010	1	23aug1961
2010	2	24aug1961
2010	3	25aug1961
2010	4	26aug1961
2010	5	27aug1961
2010	6	28aug1961
2010	7	29aug1961
2010	8	30aug1961
2010	9	31aug1961
2010	10	01sep1961

How on Earth is that possible? A minute ago ym() was working fine, I swear.

Gabi
*
*   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