Jump to content

display date readable


aebstract

Recommended Posts

$result = mysql_query("SELECT * FROM albums ORDER BY id ASC") or DIE(mysql_error());
while($r=mysql_fetch_array($result))
{

$id=$r["id"];
$superid=$r["superid"];
$date_created=$r["date_created"];
$date_modified=$r["date_modified"];
$title=$r["title"];
$bg_color=$r["bg_color"];

echo "<li><a href=\"index.php?page=edit&edit=$superid\">edit</a> | <a href=\"index.php?page=album&album=$superid\">$title</a></li>";
$date_created_readable = date('m/d/Y', $date_created);
echo "$date_created_readable";

}

 

and when I echo the date_created, it displays a unique timestamp for each result..

Link to comment
https://forums.phpfreaks.com/topic/98898-display-date-readable/#findComment-506042
Share on other sites

Yes, it appears most are on the same day.

 

<?php

$str = '1200594207
1200435878
1200435906
1200435913
1200435925
1200435930';

foreach (explode("\n", $str) as $stamp)
echo date ('m/d/Y h:i:s', $stamp) . '<br>';

?>

 

Returns

 

01/17/2008 10:23:27
01/15/2008 02:24:38
01/15/2008 02:25:06
01/15/2008 02:25:13
01/15/2008 02:25:25
01/15/2008 02:25:30

Link to comment
https://forums.phpfreaks.com/topic/98898-display-date-readable/#findComment-506055
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.