[CLUE-Tech] PHP or MySQL date handling problem

Jed S. Baer thag at frii.com
Fri Jun 14 08:41:33 MDT 2002


On Thu, 13 Jun 2002 16:42:15 -0600
Lynn Danielson <lynnd at techangle.com> wrote:

> Jed S. Baer wrote:
> > Or maybe rant ;-)
> > 
> > I've run into a problem with PHP or MySQL (or both) with the handling
> > of dates. The problem is that neither of them provides a generalized
> > date/time parser that accepts a format string. <snip>
> 
> PHP's date() function allows you to format a Unix integer timestamp into
> a string of your choice.  It's very flexible and has met all of my
> needs. You can use time(), strtotime() or mktime() functions to feed it
> timestamps.

Thanks Lynn, but nope. I have the string. I need to convert it to
something that works for MySQL. No PHP function accepts a date/time string
and a format string. (Look at man strptime. If I'm feeling _really_
ambitious someday, I'll write that into PHP or MySQL)

-- 
We're frogs who are getting boiled in a pot full of single-character
morphemes, and we don't notice. - Larry Wall; Perl6, Apocalypse 5



More information about the clue-tech mailing list