I'm having a challenge converting the date formats with slashes "2/9/2016 14:06" (m/d/yyyy hh:mm) to DDMMYYYY HH:MM:SS format (e.g 09Jan2016 14:06:00)
For the other date format ("Mar 31, 2016 8:25:13 PM") I used this which worked
gen subdate1=clock(submissiondate ,"MDYhms")
format subdate1 %tc
But need help with the other date format
See extract of the dataset below
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str24(start end) "2/9/2016 14:06" "2/9/2016 18:28" "2/22/2016 08:05" "2/22/2016 09:28" "2/9/2016 00:20" "2/10/2016 09:09" "2/9/2016 23:59" "2/10/2016 09:04" "2/9/2016 21:02" "2/9/2016 22:27" "Mar 31, 2016 8:25:13 PM" "Apr 1, 2016 9:03:41 AM" "Apr 1, 2016 5:24:44 PM" "Apr 1, 2016 9:46:25 PM" "Apr 1, 2016 10:58:05 PM" "Apr 1, 2016 1:43:15 AM" "Apr 1, 2016 4:04:35 PM" "Apr 1, 2016 8:58:48 PM" "Apr 1, 2016 11:40:21 PM" "Apr 1, 2016 1:39:46 AM" "Apr 2, 2016 8:30:49 AM" "Apr 2, 2016 9:09:13 AM" "Apr 1, 2016 7:04:51 PM" "Apr 1, 2016 7:27:24 PM" end
Thanks
0 Response to Converting Date format
Post a Comment