Extracting 2 digit hour from POSIXct in R
<p>I would like to extract the hour from a <code>POSIXct</code> time in R, but retrieve the 2 digit answer.</p>

<p>For example,</p>

<pre><code>test=as.POSIXct("2015-03-02 03:15:00")
test
[1] "2015-01-02 03:15:00 GMT"
month(testing)
[1] 1
hour(testing)
[1] 3
</code></pre>

<p>The results give the relevant month and hour, but I would like to see <code>01</code> and <code>03</code> instead of just <code>1</code> and <code>3</code>.</p>