I have a string variable for the registration data and I am trying to destring it. I am running the following command:
generate _registration_date = date(registration_date, "DMY")
However, the format of the date in the newly generated variable is not understandable. I have attached a sample using dataex.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str10 registration_date float _registration_date "05-08-2015" 20305 "23-03-2016" 20536 "05-11-2014" 20032 "14-12-2015" 20436 "09-04-2016" 20553 "01-06-2016" 20606 "10-01-2016" 20463 "30-11-2014" 20057 "12-02-2016" 20496 "31-12-2015" 20453 "11-07-2015" 20280 "22-04-2016" 20566 "10-06-2016" 20615 "24-11-2014" 20051 "27-11-2014" 20054 "26-05-2015" 20234 "03-04-2015" 20181 "23-12-2014" 20080 "12-04-2016" 20556 "22-02-2016" 20506 "27-11-2014" 20054 "09-01-2016" 20462 "01-03-2016" 20514 "24-11-2015" 20416 "21-05-2016" 20595 "30-03-2015" 20177 "10-11-2014" 20037 "01-04-2015" 20179 "30-01-2016" 20483 "01-05-2015" 20209 "27-09-2015" 20358 "12-03-2015" 20159 "16-06-2015" 20255 "24-05-2016" 20598 "08-06-2015" 20247 "19-05-2016" 20593 "23-07-2015" 20292 "13-05-2015" 20221 "14-12-2015" 20436 "30-11-2014" 20057 "29-03-2015" 20176 "10-07-2015" 20279 "24-06-2016" 20629 "10-11-2015" 20402 "04-12-2014" 20061 "13-04-2015" 20191 "01-03-2016" 20514 "28-02-2015" 20147 "12-06-2016" 20617 "18-11-2015" 20410 "29-11-2014" 20056 "05-02-2016" 20489 "08-06-2016" 20613 "08-11-2015" 20400 "04-12-2015" 20426 "27-04-2016" 20571 "07-02-2015" 20126 "15-06-2015" 20254 "07-09-2015" 20338 "05-02-2016" 20489 "18-06-2016" 20623 "11-06-2016" 20616 "30-05-2015" 20238 "31-01-2015" 20119 "05-08-2015" 20305 "05-02-2016" 20489 "10-04-2016" 20554 "24-12-2015" 20446 "21-01-2016" 20474 "30-08-2015" 20330 "14-04-2015" 20192 "31-05-2016" 20605 "09-03-2015" 20156 "16-07-2015" 20285 "02-04-2015" 20180 "28-01-2016" 20481 "02-12-2014" 20059 "08-12-2014" 20065 "22-06-2015" 20261 "13-09-2015" 20344 "16-04-2015" 20194 "22-11-2015" 20414 "06-02-2016" 20490 "22-05-2015" 20230 "20-02-2015" 20139 "25-05-2016" 20599 "14-01-2016" 20467 "01-12-2014" 20058 "18-01-2015" 20106 "04-12-2015" 20426 "11-09-2015" 20342 "22-09-2015" 20353 "29-08-2015" 20329 "13-02-2015" 20132 "23-12-2015" 20445 "05-08-2014" 19940 "12-03-2016" 20525 "03-11-2015" 20395 "17-05-2016" 20591 "05-08-2015" 20305 end
0 Response to Formatting in the command: generate _registration_date = date(registration_date, "DMY")
Post a Comment