You are here: php function to format date's time « PHP Programming Language « IT news, forums, messages
php function to format date's time

Posted by laredotornado on 02/24/06 00:35

Hi,

I am retrieving results from an SQL query, one of which is a date

$arrival = $row['itin_arrival_day'];

I would like to write a PHP function that formats the date in the
following way:

If the time part of the date is of the form 2006-05-19 00:00:00 in
which the time is midnight, I would like the result to be printed as
"05/19/06 ---" but if the time is anything other than midnight, for
example, "2006-05-21 18:00:00" I would like the printed result to be
"05/21/06 6:00 PM".

How can I do this? - Dave

 

Navigation:

[Reply to this 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

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