Announcement

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

  • changing the date format

    Dear Stata users,

    I wonder how to change the string date (for example 2012-12-17) variable into YYYY/MM/DD 00:00:00 (2012-12-17 00:00:00) format.

    Any help would be appreciated.

    Many thanks,

    Oyun

  • #2
    Code:
    generate double wanted = clock(your_date_variable, "YMD")
    format wanted %tcCCYY/NN/DD_HH:MM:SS
    See example 7 on page 5: https://www.stata.com/manuals/ddatetime.pdf

    Comment


    • #3
      Thanks very much!

      Comment

      Working...
      X