Announcement

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

  • Numeric data with hour to %td

    Hi, I have a date variable in numeric format (without labels so I cannot decode it) of the format "18jul2019 08:11:41". I am trying to turn this into a %td date (i.e. taking out the hour:minute:second) but have not managed so far. Any help would be really appreciated.

    Thank you very much!

  • #2
    Say that the variable is called datetime, then you would type
    Code:
    gen date = dofc(datetime)
    format date %td
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Works perfectly, thank you!

      Comment

      Working...
      X