Jump to content

[SOLVED] how do i change the timestamp format?


Zeradin

Recommended Posts

A mysql TIMESTAMP/DATETIME/DATE format is YYYY-MM-DD. If you have values 20DD.MM.YY, that would mean that you put a DD-MM-YY into a TIMESTAMP/DATETIME/DATE field that happened to have a DD that was a valid YY and a YY that was a valid DD so that they were accepted as being valid values.

 

You need to start by putting in YYYY-MM-DD values. You can use the mysql STR_TO_DATE() function to take any format of date/time and given a YYYY-MM-DD value.

 

To SELECT a TIMESTAMP/DATETIME/DATE value and format it any way you want on output, use the mysql DATE_FORMAT() function.

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.