Page 1 of 1

problem with datetime

Posted: Sun Jul 24, 2005 9:49 am
by illmapu
Hi,

I am storing joindates for members using datetime format.

When they join, I am storing the date with this code:

Code: Select all

$joindate = date("Y-m-d G:i:s");
It is storing as: 2005-07-24 08:46:00

I would like to disply the joindate as:

Sun Jun 24, 2005 8:46 am

I've been trying all sorts of ways and reading lots of posts to come up with an answer, but I am just having a brain block and hoping somene can save me time & frustration....lol

Thanks in advance!

Posted: Sun Jul 24, 2005 10:15 am
by John Cartwright

Code: Select all

date('D M d, Y g:ia',time());
Sometimes forums arn't the best rescource.
Long live the manual :arrow: http://ca3.php.net/date

Posted: Sun Jul 24, 2005 10:51 am
by illmapu
Thanks for replying!

Here's what I got to work:

Code: Select all

$date_formatted = date("D M d, Y g:i a", strtotime( $joindate ));
:D