title: What is the unix timestamp formula?
body: <p>First of all, i know this question has been sort of asked/sort-of answered here: <a href="https://stackoverflow.com/questions/7136385/calculate-day-number-from-an-unix-timestamp-in-a-math-way">Calculate day number from an unix-timestamp in a math way?</a> .</p>
  
  <p>I need a custom function/formula for this. so it only returns a ISO format date. "YYYY-MM-DD".</p>
  
  <pre><code>eg. 1316278442 = 2011-09-17
  </code></pre>
  
  <p>EDIT by Ext!
  THIS IS WRONG ! Please don't read this.</p>
  
  <p><strike>I've been at this all day! The only thing i managed to get out is the day of the week.</p>
  
  <p><strike>$dayOfWeek=($timestamp/86400)%7; //And here 1 is Saturday, 7 is Friday</strike>
  </strike></p>
  
  <p>Speed is the issue, that is why i don't want to use <code>date('Y-m-d',$timestamp);</code></p>
  
  <p>If you cannot help me whit a custom function or formula, at least give me a better explanation on how to do this. It was done in so many languages, there must be someone out there that knows how to do this.</p>
  
  <p>Thank you in advance for your help.</p>