title: PHP date_create failing when trying to use timestamp from mysql db
body: <p>i'm just trying to find out why i keep getting this error:</p>
  
  <pre><code>Notice: Undefined variable: flsrfc
  </code></pre>
  
  <p>now $flsrfc is set like so:</p>
  
  <pre><code>if (date_create($flstart)) {
     $flsdt = date_create($flstart);
     if ($flsdt) {
        $flsrfc = date_format($flsdt, "Y-m-d\TH:i");
     } else {
        $flsrfc = date_format(date_create(time()), "Y-m-d\TH:i");
     }
  }
  </code></pre>
  
  <p>Now the problem i'm having is attempting to set a datetime-local input with the formatted time i'm trying to get. Here is the code for that and where the error says its coming from. My guess is the date_create function isn't working but i have no friggin idea why.</p>
  
  <pre><code>$HTMLOUT .= '&lt;input name="fls" value="'.$flsrfc.'" size="30" type="datetime-local" /&gt;';
  </code></pre>
  
  <p>I made sure $flstart was getting the data from the DB and it is here's the code for it:</p>
  
  <pre><code>$flstart = mysqli_fetch_row(mysqli_query("SELECT value FROM config WHERE name = 'flstart'"))[0];
  </code></pre>
  
  <p>I've read many of the manual pages and docs for php trying to find out why, i tried strtotime on the timestamp, no go, i also tried forcing it into an integer also same problem. Could someone lease point me in the right direction? Thanks.</p>