title: Formatting time object specifying LC_TIME without changing locale
body: <p>Is there a way to format a POSIXct object in R and specifying the LC_TIME in that call?</p>
  <p>Ie I have this code which returns the object in the German format</p>
  <pre><code>t &lt;- Sys.time()
  fmt &lt;- &quot;%a, %d %b %Y %H:%M:%S GMT&quot;
  format(t, fmt)
  #&gt; [1] &quot;Mi, 23 Mrz 2022 14:57:50 GMT&quot;
  
  Sys.getlocale(&quot;LC_TIME&quot;)
  #&gt; [1] &quot;German_Germany.1252&quot;
  </code></pre>
  <p>The format I want can be achieved by setting the LC_TIME, but this is not what I want. Instead I want to find a solution without changing the options of my R session or my locale.</p>
  <pre class="lang-r prettyprint-override"><code>Sys.setlocale(&quot;LC_TIME&quot;, &quot;C&quot;)
  format(t, fmt)
  #&gt; [1] &quot;Wed, 23 Mar 2022 14:57:50 GMT&quot;
  # correct output, but changing the locale :(
  </code></pre>
  <p>Ideally, I want something like <code>format(t, fmt, LC_TIME = &quot;C&quot;)</code> or similar with minimal external dependencies and not changing anything else...</p>