title: Get hours from unix timestamp
body: <p>How can I get the current hour from a linux timestamp? I can get the year, month, day, minute, and second, but not the hour. Any help?</p>
  
  <p>Current code:</p>
  
  <pre><code>local secondsPassed = os ~= nil and os.time() or tick()
  local year = 1970 + math.floor(secondsPassed / (86400 * 365.25))
  local days = math.floor((secondsPassed % (365.25 * 86400)) / 86400)
  days = days + (year - 2011)
  local minutes = math.floor((secondsPassed % 3600) / 60)
  local seconds = math.floor(secondsPassed % 60)
  </code></pre>
  
  <p>Broken:</p>
  
  <pre><code>local hours = math.floor((secondsPassed % 86400) / 3600)-- +1
  </code></pre>