title: From character to dates-time in R using decimal hours
body: <p>I'm trying to convert characters to dates in R. </p>
  
  <p>My data as the following format:</p>
  
  <pre><code>df &lt;- data.frame(Date = c("23Jul2019 11:51:09 AM","23Jul2019 11:53:09 AM","19Jul2019 2:30:06 PM","01Aug2019 3:00:17 PM"))
  </code></pre>
  
  <p>Based on the solution found here:
  <a href="https://stackoverflow.com/questions/4310326/convert-character-to-date-in-r/4310474">Convert character to Date in R</a></p>
  
  <p>I could use</p>
  
  <pre><code>&gt; as.Date(df$Date, "%d/%b/%Y %I:%M:%S %p") 
  [1] NA NA NA NA
  </code></pre>
  
  <p>%I is for decimal hour (12h) and %p Locale-specific AM/PM (<a href="https://www.stat.berkeley.edu/~s133/dates.html" rel="nofollow noreferrer">https://www.stat.berkeley.edu/~s133/dates.html</a>) but for some reason, it returns NAs.</p>
  
  <p>My goal is to sort the rows of a dataframe by date and time once dates in the character format converted to Dates in R.</p>
  
  <p>What is the issue with the code I'm using?</p>