Jump to content

Format the look of a timestamp


86Stang

Recommended Posts

To just show or use the date part of a DATETIME or mysql timestamp, use the mysql DATE() function -

 

DATE(expr)

 

Extracts the date part of the date or datetime expression expr.

 

mysql> SELECT DATE('2003-12-31 01:02:03');

        -> '2003-12-31'

 

To format a DATE, DATETIME or mysql Timestamp, use the mysql DATE_FORMAT() function -

 

DATE_FORMAT(date,format)

 

Formats the date value according to the format string.

 

The following specifiers may be used in the format string. The “%” character is required before format specifier characters.

 

... see the table in the mysql manual for complete information...

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.