I use a JavaScript date picker for all date fields that need to be entered.
This can display in on format and present the required yyyy-mm-dd format to
MySQL.

I can send the relevant JavaScript and examples if required. I found it on
the web. It
is not my own work.

John Lodge

-----Original Message-----
From: Paul DuBois [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 3:58 PM
To: George Pitcher; [EMAIL PROTECTED]
Subject: Re: Mysql Date Functions - input


At 14:02 +0000 2/28/02, George Pitcher wrote:
>Hi all,
>
>I asked this question on the PHP-DB list but everyone was asleep (no
>response).
>
>=====  =====  ===== ===== ===== ===== =====
>I have a site where dates are being displayed and also entered by users. I
>don't want to offend them by asking them to use the yyyy-mm-dd format or to
>split the date into its constituent parts.
>
>I am displaying by using the MySQL Date_Format syntax and that's fine. I
get
>dd/mm/yyyy and I want to be able to have the user enter 'dd/mm'yyyy' into a
>form and have it put into MySQL in the yyyy-mm-dd format.
>
>Now I have written a function in php to do this but I might be missing an
>easier, more elegant/efficient way of doing this.

I'd leave the checking in PHP.  You have access to pattern matching and
reformatting capabilities that are as easy or easier to use than what
you can do with SQL, plus if you issue a query to reformat the
date and it turns out to be bad, you ran the query for nothing.

>
>Any suggestions?
>
>George P, in Edinburgh


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to