Date Formats, Current/Historical Mode, LAMP env

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm working in a Lamp environment, (actually WAMP), am using one of the
many Calendar widgets (that has configurable formats), and have a heavy
data in/data out (forms/reports) webapp.

This is probably more of a design issue, than PHP issue, but we all
deal with this.
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 and I'd like to find out what better
choices may be available.
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 ?

I have considered saving space on the screen by working with implied
years but this seems destined to prove a headache no matter what.  YY
format would be ambiguous in a decade.  Mode System:  Current or
Historical  ?   Use OO or switch() to present Xhtml reports
differently.  Can it be made to change modes automatically ?

Anyone else have this ? or have the answers to handle this (one of
Life's persistent questions)

Re: Date Formats, Current/Historical Mode, LAMP env

awebguynow wrote:
Quoted text here. Click to load it

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

Quoted text here. Click to load it

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');

Quoted text here. Click to load it

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


Site Timeline