datetime

  1. Z

    How to extract dates (years) from a datetime variable

    Hello all, I am trying to extract the years from a datetime variable and do not seem to find a way. I am attaching images of what I see on STATA. Can someone explain to me in a simple way what I should do? Thank you in advance!
  2. G

    recoding to datetime syntax

    I am trying to recode a variable. My original survey asked participants to enter a time of day they do an activity on the half hour, ranging from not applicable (coded as 1) to 12:00am on day 1 (coded as “2”) to 5:30am the following day (day 2; coded as “61”). I asked participants to enter...