title: Problem with changing format of date and time in R
body: <p>I am having a problem with date &amp; time format in R.</p>
  <p>My R code is having the format: &quot;%Y%m%d %H%M%OS&quot;. For example: &quot;20170929 20:59:56.149&quot;</p>
  <p>Time in my case is character variable.</p>
  <p>I am trying to write a R code where type of format will be converted into the format &quot;%Y-%m-%d %H:%M:%OS&quot;</p>
  <pre><code>(data &lt;- strptime(data$time, 
                      format = &quot;%Y-%m-%d  %H:%M:%OS&quot;, 
                      tz = &quot;GMT&quot;)) 
  </code></pre>
  <p>or for example</p>
  <pre><code>data$time &lt;- as.POSIXct(data$time, format = &quot;%Y-%m-%d  %H:%M:%OS&quot;)
  </code></pre>
  <p>But, I am getting NA. What could this be caused by? Do you have any idea how to fix it? Thank you in advance for your help!</p>