R strptime to 00h00 Format
<p>How can I strptime a character like "15/09/2016 20h26"?</p>

<p>I searched this on the strptime official manual and arround the Stack overflow, but I didn't find anything that could help me.</p>

<p>I tried this code:</p>

<pre><code>u &lt;- ("15/09/2016 20h26")
strptime(u, format = "%d/%m/%Y %H:%M")
</code></pre>

<p>and</p>

<pre><code>strptime(u, format = "%d/%m/%Y %H'h'%M")
</code></pre>

<p>Anyone has any idea of what I need to do?</p>

<p>Edit:</p>

<p>Firstly, sorry for the clearness of the question.</p>

<p>I tried to use a sample to describe my problem, but it seems like a typo.</p>

<p>I have a txt file with 400 observations of time in the format "20/01/2016 14h00". I'm trying to convert this to date with strptime:</p>

<p>here is my code:</p>

<pre><code>y &lt;- read.table('materias_data.txt', sep = ";")
l &lt;- strptime(y, format = "%d/%m/%Y %Hh%M")
</code></pre>

<p>I got this error when I run the code:</p>

<blockquote>
  <p>Error in strptime(y, format = "%d/%m/%Y %Hh%M") :     input string is
  too long</p>
</blockquote>

<p>What can I do to convert correctly the data.frame?</p>

<p>Edit 2: Solution</p>

<p>Reading the comments I realized what the problem is:</p>

<p>strptime doesn't work to data.frame but it works on characters.</p>

<p>The step to solve this is</p>

<pre><code>y &lt;- read.table('materias_data.txt', sep = ";")
l &lt;- strptime(y[,1], format = "%d/%m/%Y %Hh%M")
df &lt;- data.frame(l)
</code></pre>

<p>Thank You</p>