Announcement

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

  • converting a string date into numeric date

    Dear Stata users,

    I have a date variable under which the values are in string format, e.g, 1996m1. Is there any way to convert it back to numeric date in year-month format?

    Thanks,

    Mohammad Zariab Hossain
    Uppsala University

  • #2
    Code:
    gen wanted = monthly(string_variable, "YM")
    format wanted %tm

    Comment


    • #3
      Thanks a lot Clyde! It worked.

      Comment

      Working...
      X