title: String timestamp to int, make a DateTime with it afterwards in PHP
body: <p>I want to know if a timestamp stored in my database as a bigint (I'm using mariaDB) is already old comparing it to the current date, there's one example:</p>
  
  <p>I have this timestamp stored in my <code>db = 1560499685530</code> but for some reason, it is a string when I fetch it from my db so I got this error when trying to set its timestamp (setTimestamp($timestamp))</p>
  
  <blockquote>
    <p>DateTime::setTimestamp() expects parameter 1 to be integer, string
    given</p>
  </blockquote>
  
  <p>I tried using <code>intval</code> but my timestamp seems to be too long to be <code>int</code> because when I use <code>inval</code> it returns another int, smaller than mine, I guess that's the PHP int cap</p>
  
  <p>I want my PHP to print if it's already an old date comparing it to the current date and wrote this code</p>
  
  <pre><code>$qBloqueo = mysqli_query($conn, "SELECT * FROM dates WHERE idUsuario = '$idUsuario'") or die(mysqli_error($conn));
  
  $timestamp = mysqli_fetch_assoc($qBloqueo);
  $timestamp = intval($timestamp['timestamp']); // Getting the timestamp from my db which is a string, still dunno why, in my db it's a bigint
  
  $today = new DateTime();
  $expireDate = new DateTime();
  $expireDate-&gt;setTimestamp($timestamp);
  
  if($today-&gt;format("Y-m-d") &gt; $expireDate-&gt;format("Y-m-d")) { 
      print('Old date ^u^');
  } else {
      print('Not yet');
  }
  </code></pre>
  
  <p>How can I use a timestamp to make a date obj without been a int or there is any way to convert it from a string to int? I just want to make a date from a string timestamp so I could compare it to the current date</p>