title: Convert exact Sys.time() output to string / character in R?
body: <p>How can we get the exact printed output of <code>Sys.time()</code> (e.g. <code>&quot;2020-01-14 17:21:31 AEDT&quot;</code>) as a string / character vector?</p>
  <h3>Background</h3>
  <p>The output of my <code>Sys.time()</code> is</p>
  <pre><code>[1] &quot;2020-01-14 17:21:31 AEDT&quot;
  </code></pre>
  <p>the <code>dput()</code> of which is</p>
  <pre><code>structure(1578982891.74164, class = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;))
  </code></pre>
  <p>In the console, it looks like it might be of <code>class</code> <code>character</code>, but as we can see from the <code>dput</code> (or by calling <code>class()</code>) it isn't</p>
  <pre><code>structure(1578982891.74164, class = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;)) %&gt;% class()
  [1] &quot;POSIXct&quot; &quot;POSIXt&quot; 
  </code></pre>
  <p>The exact output I am after is <code>&quot;2020-01-14 17:21:31 AEDT&quot;</code>, where <code>&quot;2020-01-14 17:21:31 AEDT&quot; %&gt;% class</code> is <code>character</code>.</p>
  <p>Also note: I would like to <strong>not</strong> use external packages for this</p>
  <h3>What I've tried so far</h3>
  <p>The obvious thing to try, <code>Sys.time() %&gt;% as.character</code>, removes the characters at the end (<code>AEDT</code> in this case), which is <strong>not</strong> not desired here</p>