title: HTML Input Type Time Set Value using PHP
body: <p>I'm trying to display Time in my HTML Input Type Time with AM/PM but it seems that my code is not displaying in the Input Type.</p>
  
  <p>Here's my output for HTML Input Time.</p>
  
  <pre><code>9:00 AM
  </code></pre>
  
  <p>But my HTML Input Type Time is still</p>
  
  <pre><code>--:-- --
  </code></pre>
  
  <p>Here's my <strong>Code.</strong></p>
  
  <pre><code>&lt;?php
                                      //set up mysql connection
                                      mysql_connect("localhost", "root", "") or die(mysql_error());
                                      //select database
                                      mysql_select_db("db") or die(mysql_error());
                                      //select all records form tblmember table
                                      $query = 'SELECT * FROM newsfeed';
                                      //execute the query using mysql_query
                                      $result = mysql_query($query);
                                     //then using while loop, it will display all the records inside the table
                                      while ($row = mysql_fetch_array($result)) { ?&gt;
        &lt;div class="modal fade" id="myModal&lt;?php echo $row['id'] ?&gt;" role="dialog"&gt;
            &lt;div class="modal-dialog"&gt;
  
                &lt;!-- Modal content--&gt;
                &lt;div class="modal-content"&gt;
                    &lt;div class="modal-header"&gt;
                        &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                        &lt;h4 class="modal-title"&gt;Admin&lt;/h4&gt;
                    &lt;/div&gt;
                    &lt;div class="modal-body"&gt;
                        &lt;form id="updateform" action="admin_update.php" method="post"&gt;
                            &lt;fieldset&gt;
                              &lt;!-- image-preview-filename input [CUT FROM HERE]--&gt;
                                &lt;div class="form-group"&gt;
                                    &lt;img src="&lt;?php echo $row['image'] ?&gt;" class="img-responsive" /&gt;
                                &lt;/div&gt;
                                &lt;div class="form-group"&gt;
                                    &lt;label&gt;When&lt;/label&gt;
                                    &lt;br/&gt;
                                    &lt;input type="time" class="form-control" value="&lt;?php $date = date("h:i A", strtotime($row['time_d'])); echo "$date"; ?&gt;" id="until_t" name="until_t" /&gt;
                                    &lt;br/&gt;
                                &lt;/div&gt;
                        &lt;div class="modal-footer"&gt;
                            &lt;input type="submit" id="btnsave" name="btnsave" class="btn btn-default" value="Save" /&gt;
                            &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;/form&gt;
            &lt;/div&gt;
        &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
  
              &lt;?php } ?&gt;
  </code></pre>