[dev] feature request : monthdayyear $format_in which use strftime()

Marko Djukic marko at oblo.com
Wed Apr 16 05:11:25 PDT 2003


Quoting Matthieu Foillard <m.foillard at photoways.com>:

> Be able to specify $format_in using strftime() format so that i can hold
> date in any format like oci8 date, e.g. 17-OCT-78

ok i have a bit of a dilemma with this problem:

the trouble of having a format_in specifiable with strftime() type string would
mean that the code would have to know how to parse an incoming variable (in any
variety of strftime() formats) into month day and year components for use in
the form. it doesn't look like a minor tweak to get this working.
at the moment this is limited to just three types as supported by PEAR's
Date.php plus the yyyy-mm-dd format which is not supported by PEAR, but an
extra check was added in the Form.php code.

1. move entirely to specifiying a strftime() type format for storing
monthdayyear values, but then we'd need another layer of translation code to
get it parsed into components. doesn't sound like a good idea.

2. add another format dd-MMM-yy to the Form.php (outside of PEAR) code? don't
particularly like this sitting on the fence half using Date.php half not using
it. i'd prefer using entirely the one date class or if it's not up to it then
creating our own? or submitting a patch for PEAR perhaps?

3. plus are there other obvious date formats used by other DBs that are being
missed here?

4. any other solutions?

i have no experience with oci8 but apparently one other solution is to set oci8
to use plain old sql date format (which would seem to be the best alternative
for now rather than turning upsidedown the monthdayyear code yet again):
http://www.zend.com/tips/tips.php?id=96&single=1

marko


More information about the dev mailing list