Announcement

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

  • Calculating date from day of year and year

    Hi there,

    I have a day-of-year variable (1 - 366), and year variable (4- digit, i.e. - 2012, etc) and I need to caclulate the specific date but cannot seem to find a way to get it. Any suggestions?
    thanks

  • #2

    Code:
    gen wanted = mdy(12, 31, year - 1) + dayofyear
    or

    Code:
    gen wanted = mdy(1, 1, year) + dayofyear - 1

    Comment


    • #3
      thanks so much!

      Comment

      Working...
      X