title: Calculate hours ago using server time in php without any other date
body: <p>I need to calculate hours using Server time in php without any other or MySQL dates</p>
  
  <p>Server time Screen shot</p>
  
  <p><img src="https://i.stack.imgur.com/rp3GV.jpg" alt="server time "> </p>
  
  <p>and I just confuse myself how to convert server time to this hour <code>(6 hours ago)</code></p>
  
  <p>Here is my attempt when I tried myself but I am not sure is this correct way or not.</p>
  
  <pre><code>echo $diff = date("H",abs(strtotime(date("Y-m-d h:i:s a")) - strtotime(date("Y-m-d 0:0:0 a"))));
  </code></pre>