Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stata: Date display bug?

    Dear all,

    I would like to display a date variable formatted as "1 Jun 2009". However, I wonder whether there is a bug for this display format for years 2000 until 2009, while the other years get displayed properly. Specifically:

    Code:
    webuse grunfeld, clear
    replace year = year + 60
    gen Date = mdy(6, 1, year)
    format Date %dd_m_cy
    gives

    Click image for larger version

Name:	StataDateBug, 2021-12-15.png
Views:	1
Size:	35.4 KB
ID:	1641081


    Can you reproduce this or am I missing something?

    Thanks for looking into this.

    Best,
    Ingo


  • #2
    You need to go back and review date time formats. I think this is what you want (not tested).
    Code:
     
     format Date %tdDD_Mon_CCYY

    Comment


    • #3
      Thanks, Leonardo, for the quick reply. This works.

      Comment

      Working...
      X