Convert 12-hour date/time to 24-hour date/time

Posted by Patrick Cuff on Stack Overflow See other posts from Stack Overflow or by Patrick Cuff
Published on 2009-01-13T17:59:28Z Indexed on 2010/04/13 1:33 UTC
Read the original article Hit count: 582

Filed under:
|
|

I have a tab delimited file where each record has a timestamp field in 12-hour format:

mm/dd/yyyy hh:mm:ss [AM|PM].

I need to quickly convert these fields to 24-hour time:

mm/dd/yyyy HH:mm:ss.

What would be the best way to do this? I'm running on a Windows platform, but I have access to sed, awk, perl, python, and tcl in addition to the usual Windows tools.

© Stack Overflow or respective owner

Related posts about conversion

Related posts about datetime