Announcement

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

  • How to destring time

    Dear all, I am trying to destring time variable but it's not successful.Please help me


    clear
    input str6 time_interview_started
    "12:50:"
    "03:06:"
    "12:20:"
    "12:21:"
    "12:37:"
    end



  • #2
    Never try to destring time variables. That's because they do not contain values like 1259 and 1300, because 13:00 - 12:59 is not 41 minutes.

    Read

    Code:
    help dates
    You need

    Code:
     
    gen double wanted = clock(time_interview_wanted, "hm") 
    format wanted %tc_HH:MM
    and note that the result is in milliseconds.


    Comment


    • #3
      Thanks Nick.

      Comment

      Working...
      X