The way I post time is as follows:
- When I create a table, I create a column for date of type DATETIME. E.g.
create table trash (
posted DATETIME,
....
- Whenever I want to post the current date, I just do:
insert into trash (posted) values(now())
- The query will post the current date as yyyy-mm-dd hh:mm:ss
Whenever I read the date from the database (SELECT posted FROM trash), it comes out as 2002-12-21 16:08:49. But I usually want my date in the form:
Thu, 21 Dec 2002 16:08:49.
So, I format it as follows:
$i = explode(" ", $posted);
$j = explode(":", $i[1]);
$k = explode("-", $i[0]);
$posted = date("D, d M Y H:i:s", mktime($j[0],$j[1],$j[2],$k[1],$k[2],$k[0]));
echo "$posted";
Richie.
www.geocities.com/akindele/