date format
Moderator: General Moderators
date format
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)
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)
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
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
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
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
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
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).
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: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).
What does the format have to do with selecting between "2 special days"?