Jump to content

change date format


busnut

Recommended Posts

G'day

 

I've tried finding the answer on google, but it seems to be giving me the end user result, what i'm looking for is in myphpadmin panel, I want to change the preset date format of 0000-00-00 (which appears to represent year/month/day) to be 00-00-0000 (day/month/year or d/m/Y), but everwhere i've read it shows code you put into the php file.

So currently my 1900 odd records are all in d/m/Y format, and trying to insert all of them into the database is not working as it keeps going back to its date format default.

I've selected 'Date' as the type for this field, so not sure if thats the right thing to do first, if not, what is, and if it is, how do I change the format?

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/143373-change-date-format/
Share on other sites

You can't change the date format in MySQL. It's fixed, and for a good reason. You can however change the way it is displayed. Most of the time it is done in PHP that's why you get so many hits for that. There are however MySQL date formatting functions.

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html

Link to comment
https://forums.phpfreaks.com/topic/143373-change-date-format/#findComment-751979
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.