title: Query to Convert a specific 12 hour format type to 24 hour format type in sql server 2016
body: <p>We have a case where the time edited by users is in the format <code>3/2/20 3:30P</code> (where P denotes P.m.) which I'm trying to convert to the 24hour format to be able to use a join condition with a standard column to something like <code>2020-03-02 15:30:0000</code></p>
  
  <p>e.g. <code>3/2/20 3:30P</code> to <code>2020-03-02 15:30:0000</code></p>
  
  <p>Tried the below ways in one of the answers in StackOverflow, but it didn't work:</p>
  
  <pre><code>SELECT CONVERT(DATETIME, '10/1/2013 6:39:04  PM', 0)  
  -- Concatenate in required format
  SELECT CONVERT(VARCHAR(10), CONVERT(DATETIME, '10/1/2013 6:39:04  PM', 0), 101) 
  + ' '+ CONVERT(VARCHAR(5),CONVERT(DATETIME, '10/1/2013 6:39:04  PM', 0), 108) 
  </code></pre>