List:General Discussion« Previous MessageNext Message »
From:John Lodge Date:February 28 2002 4:57pm
Subject:RE: Mysql Date Functions - input
View as plain text  
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:paul@stripped]
Sent: Thursday, February 28, 2002 3:58 PM
To: George Pitcher; mysql@stripped
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 <mysql-thread101372@stripped>
To unsubscribe, e-mail
<mysql-unsubscribe-JML=redwoodtech.com@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Thread
Mysql FunctionsAmit Dilip Lonkar28 Feb
  • Mysql Date Functions - inputGeorge Pitcher28 Feb
    • Re: Mysql Date Functions - inputPaul DuBois28 Feb
RE: Mysql Date Functions - inputJohn Lodge28 Feb
Re: Mysql Date Functions - inputMarjolein Katsma28 Feb
  • Re: Mysql Date Functions - inputKeith C. Ivey28 Feb
Re: Mysql Date Functions - inputMarjolein Katsma1 Mar