title: Getting previous day's date in Unix
body: <p>I am using the following code to assign previous day's date to a variable <em>yesterday</em>:</p>
  
  <pre><code>yesterday=`TZ=GMT+24 date +%Y%m%d`;
  echo $yesterday;
  </code></pre>
  
  <p>The value is assigned correctly when I execute the command during early morning hours.
  But during night hours (around 9 PM), I am not getting the previous day date, but the same date as today.</p>
  
  <p>My server is located in PDT timezeone.
  I tried "TZ=PDT+24" for assigning, but got the same result.</p>
  
  <p>FYI, I am using Solaris 5.10.</p>
  
  <p>What can be the reason for this bizarre situation?</p>