php/mysql time questino

Soldato
Joined
1 Feb 2006
Posts
8,188
Hi, I posted a while back about inserting the current time into a mysql db and was told to do so using the now() function.

When I recall this value it looks something like:
2007-02-24 14:59:42

I would like to format this as

Monday 24th Feb 2007, 14:59 (drop the tenth of seconds)

Anyone know how I can do this? I really do not have a clue. Also I want to be able to format the date to say 'today' or 'yesterday' if appropriate otherwise display like the format i mentioned.

Would appreciate any help on this.
 
cheers for the help - it makes sense ok but i'm just not sure how I will use it to format my output.

Basically I am echoing stuff out of a database so my line of code for the time is like this:

echo $row['time_added'];

I have one query that pulls everything out of the database and echoes it all out at once. Do I need a separate query to select which format the time is pulled out in?

Cheers
 
Back
Top Bottom