Reply to Re: Formatting PHP Time

Your name:


Posted by DXTrim on 02/14/06 18:10

Hello Eli,

You could try this:

$t2 = date('M d, Y g:i', stringtotime($t));

I have not tested if your format is correct.

Hope this helps.



"Eli" <> wrote in message
> 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
> 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
> 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
> 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

[Back to original message]

Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация