Statalist


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

st: re: AW: Using dates


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: re: AW: Using dates
Date   Wed, 15 Apr 2009 10:18:37 -0400

<>
Martin's advice for formatting months seems to be rather dangerous:

. format month %12.0g

. l

     +--------------------------------------------------------+
     |  strdate     numdate   year   month   day   week   dow |
     |--------------------------------------------------------|
  1. | 20090102   02jan2009   2009       1     2      1     5 |
  2. | 20090107   07jan2009   2009       1     7      1     3 |
  3. | 20090112   12jan2009   2009       1    12      2     1 |
  4. | 20090126   26jan2009   2009       1    26      4     1 |
     +--------------------------------------------------------+

. format month %tmmon

. l

     +--------------------------------------------------------+
     |  strdate     numdate   year   month   day   week   dow |
     |--------------------------------------------------------|
  1. | 20090102   02jan2009   2009     feb     2      1     5 |
  2. | 20090107   07jan2009   2009     feb     7      1     3 |
  3. | 20090112   12jan2009   2009     feb    12      2     1 |
  4. | 20090126   26jan2009   2009     feb    26      4     1 |
     +--------------------------------------------------------+

The month should be jan, not feb.


Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html



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