title: PHP Current time in Hour:Minutes
body: <p>I want to have have 2 variables with the current time in hours:minutes and also one that has +15 minutes. But first I must also add +6 hours.</p>
  
  <p>So for example, right now it is <code>2018-01-07 16:35:10</code>. So first I add +6 hours. So it will be <code>2018-01-07 22:35:10</code>. Next, I want to extract only the hours:minutes.</p>
  
  <p>I want to get only "22:35" to variable.</p>
  
  <p>And next variable, I want 22:35 +15 minutes, so 22:50.</p>
  
  <p>So I have <code>$dateNow = 22:35</code> and <code>$dateThen = 22:50</code></p>
  
  <p>I have tried this so far to get current time now and +6 hours, but it's not working. Error: <code>Call to a member function format() on integer</code></p>
  
  <pre><code>$now = strtotime(date("Y-m-d H:i:s")." +6 hours");
  $then = $now-&gt;format('H:i');
  echo $then;
  </code></pre>