Feb 2 2016 12:00AM
Feb 15 2015 05:00PM
Would like to convert the above data to 'YYYY-MM-DD TT:TT:TT' format, ideally:
2016-02-02 00:00:00
Here's what I've tried using a substitution to convert it. The reason I have two different ones is because when I BCP out my data into a text file the dates with single digit uses a space instead of a 0 in front of it:
s/Feb (\d{1}) (\d{4}) (\d{2})(\:\d{2})AM/2-$1-2 $3$4/g;
s/Feb (\d{2}) (\d{4}) (\d{2})(\:\d{2})AM/2-$1-2 $3$4/g;
Also I am not sure how I would go about converting the time to military time and also would there be a more efficient way to do all 12 months rather then have 12 lines of substitution for all of them, in this case there would be 24.