You are here: Re: Date Formats, Current/Historical Mode, LAMP env « PHP Programming Language « IT news, forums, messages
Re: Date Formats, Current/Historical Mode, LAMP env

Posted by NC on 10/21/74 11:59

awebguynow wrote:
>
> My 1st priority has been for simplicity, so I have used
> std. MySQL format for the text input that feeds into the
> table.Column.
>
> There are problems with that

The only real problem is that MySQL supports wider range
of dates than PHP does. The rest is a matter of convention.

> Obviously, choosing another format for forms-reports
> would require manipulation of date to/from DB. What
> is the best way this be implemented with consistency ?

function date2date($string, $format = 'Y-m-d') {
$ts = strtotime($string);
if ($ts == -1) {
return false;
} else {
return date($format, $ts);
}
}

To convert a string representation of a date into the MySQL
format, call

date2date('September 25, 2006');

To present the date retrieved from MySQL in the format of
yout choice, call

date2date($date_from_MySQL, 'Format of your choice');

> Mode System: Current or Historical ?

I'm afraid I don't understand what this means... Would you
care to elaborate?

Cheers,
NC

 

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

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