Sunday 15 June 2014

php - How can I present the day and time in a more presentable way from sql database -


I am submitting information using database from php but I presented it in a more favorable manner than 2015-05. I want to do it -

Many thanks!

  & lt; Link rel = "stylesheet" href = "css / tables.css" & gt; & Lt ;? Php Required './db/connect.php'; Include './includes/header.php'; ? & Gt; & Lt; H2 & gt; Display & lt; / H2 & gt; & Lt; Div class = "displayable" & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; Th & gt; & Lt; U & gt; Display name: & lt; / U & gt; & Lt; / Th & gt; & Lt; Th & gt; & Lt; U & gt; Display date and time: & lt; / U & gt; & Lt; / Th & gt; & Lt; / TR & gt; & Lt; Br> & Lt ;? Php if ($ result = $ connection- & gt; query ("Select * from display")) {if ($ count = $ result-> num_rows) {while ($ row = $ result-> Fetch_object ()) {? & Gt; & Lt; TR & gt; & Lt; Td square = "first column" & gt; & Lt ;? Php echo $ row-> Name; ? & Gt; & Lt; / TD & gt; & Lt; Td square = "second column" & gt; & Lt ;? Php echo $ row-> time; ?} & Gt; & Lt; / TD & gt; & Lt; Td square = "" & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Div & gt; & Lt ;? Php $ result-> free (); }} Mysqli_close ($ connection); Include ./includes/footer.php';?>  

you use strtotime ()

  $ Can date date = '2015-05-09 20:15:00'; Echo Date ('LDS: O FFH: I.S.A.', Straotomem ($ Datetime)); Using  

or other patterns like

  date ('H: ID / M / Y', stratum ($ datetime));  

or

  date ('d / m H: i', stratum ($ datetime));  

See what you can do:


No comments:

Post a Comment