Page 1 of 1

date format

Posted: Sun Jul 22, 2007 5:35 am
by m2babaey
Hi
when you check phpmyadmin you find the default format of date yyyy-mm-dd
can that be changed be work properly ( work properly means enable us to select result between 2 special days)

Posted: Sun Jul 22, 2007 6:57 am
by feyd
What does the format have to do with selecting between "2 special days"?

Posted: Sun Jul 22, 2007 8:26 am
by m2babaey
feyd wrote:What does the format have to do with selecting between "2 special days"?
I just said something in the air
But you mean it's possible to change the date format?

Posted: Sun Jul 22, 2007 1:07 pm
by Benjamin
m2babaey wrote:But you mean it's possible to change the date format?
No, he asked a fairly simple question. What are you trying to do?

Posted: Sun Jul 22, 2007 1:36 pm
by m2babaey
I have made a payment tracking system and use popup date picker.
look at http://pedia.sys17.net/payment/insert.php
(username=exodus pass: digital )
that date picker sends this format: mm/dd/yyyy
but my date field in database is yyyy-mm-dd (or yyyy-dd-mm)
so the data will not be inserted in the database. so i'd like to change the database date format

Posted: Sun Jul 22, 2007 4:27 pm
by feyd
You could convert the format before handing the data off to the database.. :o

Posted: Sun Jul 22, 2007 7:39 pm
by m2babaey
you mean I correct the data i'm sending to database instead of changing the date format of the database field?
that's right. but since I used a popup date picker Java script and do not know JAva myself (get the script from the net) I didn't know how to change the date fromat the popup date picker results in. this is why i thought maybe i can change the date format of the database field :P

Posted: Sun Jul 22, 2007 8:03 pm
by feyd
....in PHP....

Posted: Sun Jul 22, 2007 9:11 pm
by superdezign
You put it in the database however you want. MySQL can't force you to use their date format. If you really want to use a different format, you go ahead and do it. Make a varchar field for dates and knock yourself out.

However, you'll lose the ability to use MySQL date functions, and you'll no longer be able to order results accurately by date (unless you keep a year-month-day-hour-minute-second format).

Posted: Sun Jul 22, 2007 9:19 pm
by m2babaey
However, you'll lose the ability to use MySQL date functions, and you'll no longer be able to order results accurately by date (unless you keep a year-month-day-hour-minute-second format).
this is the answer of the second post:
What does the format have to do with selecting between "2 special days"?