|
Posted by Sandman on 03/13/06 08:36
In article <1142226747.422197.315630@i39g2000cwa.googlegroups.com>,
"adrian.price@gmail.com" <adrian.price@gmail.com> wrote:
> I've had a lot of success (and some serious "wow, that's cool"
> reactions from users and execs) with a combination of strtotime and
> active reponse to the user. I don't know what kind of target platform
> you're looking at, but if you're able to expect a fairly recent browser
> of your users, try using plain-text date fields with a JavaScript event
> that makes an XmlHttpRequest back to your server, to a script (only
> needs to be about 5 lines long) that returns the strtotime() of the
> input text. It then replaces what the user typed into the date field
> with the response from the server. So, for example, they type "next
> tuesday", hit tab, the field fills out the full date and time, and they
> can look at it and see that it's correctly interpretted their
> plain-english date.
That's exactly how I do it.
> Also, as far as storing dates in MySQL itself - I've gotten in the
> (admittedly somewhat odd) habit of storing all dates in the DB as plain
> integer columns holding a UNIX timestamp. It may seem odd, but it
> works, and it's what I'm used to, because I learned PHP/MySQL from
> modding phpBB.
But it's a killer for complicated date queries on huge tables.
--
Sandman[.net]
Navigation:
[Reply to this message]
|