Jump to content

Dates and European date format


Petty_Crim

Recommended Posts

ATM my database is using an American style date format with the year coming first, then the month then the day, is there a way to set it so it goes day, month, year?

 

Basically how it works is I got 3 drop down boxes with days, months and years in it. The user choose the desired date clicks a button and it updates the db. My problem is its has that American format and if I put it as text then I won't be able to do calculations or sorts on the date so I need it as a date.

 

Also do I need to actually change anything in my mysql data base in regards to the date field atm I got it set as a date is there any additional things I gotta change?

 

 

Link to comment
Share on other sites

I think there is a way, but that is the basis behind all mysql systems.

 

You'd be better off just formatting the date in the mysql query. eg

 

SELECT DATE_FORMAT(`datecolumn`, '%d/%c/%Y') from ... WHERE ...

 

that would brind the date in the table out inthe form of DD/MM/YYYY.

 

 

Link to comment
Share on other sites

I find it easier to store dates in thte american format of yyyy/mm/dd as I can thten order items from the database by date, without having to add extra code.

I then 're-arrange' the date if I need to display it to dd/mm/yyyy, but leaving in american format in thte database.

Link to comment
Share on other sites

I find it easier to store dates in thte american format of yyyy/mm/dd as I can thten order items from the database by date, without having to add extra code.

I then 're-arrange' the date if I need to display it to dd/mm/yyyy, but leaving in american format in thte database.

Yep thats what this is doing, they are stored in American format in the database but when I show it on screen it comes out as European format.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.