Re: checking user input of MM-DD-YYYY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 15, 2008 2:38 PM, Richard Lynch <ceo@xxxxxxxxx> wrote:
> On Tue, January 15, 2008 12:31 pm, Adam Williams wrote:
> > Andrew Ballard wrote:
> > I don't see the point in needing to convert it to a timestamp.  The
> > length_start and length_end fields in MySQL are defined as date
> > fields.
> > All I care about is the date, not the hours/minutes/seconds.  If I
> > insert it as date('Y-m-d', $length_start) then when I SELECT it back
> > out, I will still have to do a date conversion back to MM-DD-YYYY when
> > I
> > display it to the user.
>
> No.

Well, true. I guess what I meant is that MySQL requires to be entered
as YYYY-MM-DD, and they always (at least that I've seen) comes back
out the same way. I don't really know how it's actually stored. I'm
sure that depends on the engine as well.

> MySQL is going to store it internally however it wants, regardless of
> how you get it in there.
>
> And you'll want to format it (or use MySQL default) independent of
> what you use to get it in there.

Exactly.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux