problem with datetime

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
illmapu
Forum Commoner
Posts: 47
Joined: Fri Aug 22, 2003 1:48 pm

problem with datetime

Post 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!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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
illmapu
Forum Commoner
Posts: 47
Joined: Fri Aug 22, 2003 1:48 pm

Post 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
Post Reply