title: finding yesterday's date using R
body: <p>In one of my R scripts I need to find the date of yesterday, I can do that easily on my mac with this command.</p>
  
  <pre><code>yesterday &lt;- format(Sys.Date()-1,"%m/%d/%Y")
  yesterday
  [1] "03/17/2017"
  </code></pre>
  
  <p>So essentially the <code>Sys.Date()-1</code> gives me yesterday's date. However, when I run this command on my ubuntu 16.04 machine(AWS instance) it doesn't work. It returns today's date instead? Has anyone else experienced this? How could I get yesterday's date without using the <code>Sys.Date()-1</code> command? </p>
  
  <p><strong>UPDATE</strong>: Amazon AWS says the server location is in N. California, however upon further inspection it seems that the server's timezone is in fact 7 hours ahead? I used this tool, <a href="https://www.iplocation.net/" rel="noreferrer">IP Location Finder</a> to try to geo-locate the IP address, and the IP was found in N.Califorina? Confusing but for now I'm just adding 7 hours to my date variable and it's a short term fix, but I would like to understand what's causing this timezone issue. </p>