Formatting PHP Time
- From: "Eli" <none@xxxxxxxx>
- Date: Thu, 26 Jan 2006 01:55:39 -0500
Hi,
I have time stored as the following: YYYY-MM-DD HH:MM:SS, so it gives
something like 2006-01-26 01:40:14. I'm trying to get the format to be Jan
26, 2006 1:40. I try something like this:
$t2 = date('M d, Y g:i', $t);
But it gives the wrong date, so I must be doing something wrong. I've looked
all over for date formatting but they only seem to be able to format the
date and then insert it into the database, but my database already has dates
in this format and I'd prefer not to change the way the dates are stored.
Can you help explain the proper way to format a date?
I also attempted to store the date/time as a timestamp but was never
successful at acheiving that. I produced the timestamp (lots of numbers),
but when I tried to put it into the database, it seemed to reject it and I
ended up with 0000-00...etc.
Thanks,
- Eli
.
- Prev by Date: Re: Apache, PHP, FOPEN Permissions problem
- Next by Date: "Read .htaccess file rights with php"-script wanted
- Previous by thread: PLEASE HELP ME ($20 REWARD!!) PHP(v5.0.4)/MySQL(v4.1.14) Problem. Need Basic Drop-down menu populated by 1 column from MySql
- Next by thread: "Read .htaccess file rights with php"-script wanted
- Index(es):
Relevant Pages
|