title: Given a Unix timestamp, how to get beginning and end of that day?
body: <p>I have a Unix timestamp like this:</p>
  
  <pre><code>$timestamp=1330581600
  </code></pre>
  
  <p>How do I get the beginning of the day and the end of the day for that timestamp?</p>
  
  <pre><code>e.g.
  $beginOfDay = Start of Timestamp's Day
  $endOfDay = End of Timestamp's Day
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>$endOfDay = $timestamp + (60 * 60 * 23);
  </code></pre>
  
  <p>But I don't think it'll work because the timestamp itself isn't the exact beginning of the day.</p>