"MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format." This is from mysql site. You can store only this type, but you can use one of the many time format functions to change it, when you need to display it.

Mysql Time and Date functions

For example, one of those functions is the DATE_FORMAT, which can be used like so:

SELECT DATE_FORMAT(column_name, '%m/%d/%Y %H:%i') FROM tablename
Answer from Mirko Akov on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ sql โ€บ func_mysql_date_format.asp
MySQL DATE_FORMAT() Function
String Functions: ASCII CHAR CHARINDEX CONCAT Concat with + CONCAT_WS DATALENGTH DIFFERENCE FORMAT LEFT LEN LOWER LTRIM NCHAR PATINDEX QUOTENAME REPLACE REPLICATE REVERSE RIGHT RTRIM SOUNDEX SPACE STR STUFF SUBSTRING TRANSLATE TRIM UNICODE UPPER Numeric Functions: ABS ACOS ASIN ATAN ATN2 AVG CEILING COUNT COS COT DEGREES EXP FLOOR LOG LOG10 MAX MIN PI POWER RADIANS RAND ROUND SIGN SIN SQRT SQUARE SUM TAN Date Functions: CURRENT_TIMESTAMP DATEADD DATEDIFF DATEFROMPARTS DATENAME DATEPART DAY GETDATE GETUTCDATE ISDATE MONTH SYSDATETIME YEAR Advanced Functions CAST COALESCE CONVERT CURRENT_USER IIF ISNULL ISNUMERIC NULLIF SESSION_USER SESSIONPROPERTY SYSTEM_USER USER_NAME MS Access Functions
๐ŸŒ
MySQL
dev.mysql.com โ€บ doc โ€บ en โ€บ date-and-time-functions.html
MySQL :: MySQL 8.4 Reference Manual :: 14.7 Date and Time Functions
When adding a MONTH interval to a DATE or DATETIME value, and the resulting date includes a day that does not exist in the given month, the day is adjusted to the last day of the month, as shown here: mysql> SELECT DATE_ADD('2024-03-30', INTERVAL 1 MONTH) AS d1, > DATE_ADD('2024-03-31', INTERVAL 1 MONTH) AS d2; +------------+------------+ | d1 | d2 | +------------+------------+ | 2024-04-30 | 2024-04-30 | +------------+------------+ 1 row in set (0.00 sec) ... Formats the date value according to the format string.
๐ŸŒ
DEV Community
dev.to โ€บ salmazz โ€บ mysql-using-and-enhancing-datetime-and-timestamp-4bpm
MySQL: Using and Enhancing `DATETIME` and `TIMESTAMP` - DEV Community
June 19, 2024 - DATETIME: Stored as is, in date and time format, without relying on the time zone. It requires 8 bytes of storage. TIMESTAMP: Stored as an integer representing the number of seconds since 1970-01-01 00:00:00 UTC.
๐ŸŒ
MySQL
dev.mysql.com โ€บ doc โ€บ refman โ€บ 8.4 โ€บ en โ€บ date-and-time-literals.html
MySQL :: MySQL 8.4 Reference Manual :: 11.1.3 Date and Time Literals
As a number in either YYYYMMDDhhmmss or YYMMDDhhmmss format, provided that the number makes sense as a date. For example, 19830905132800 and 830905132800 are interpreted as '1983-09-05 13:28:00'. A DATETIME or TIMESTAMP value can include a trailing fractional seconds part in up to microseconds ...
Find elsewhere
๐ŸŒ
MySQL Tutorial
mysqltutorial.org โ€บ home โ€บ mysql basics โ€บ mysql insert datetime
MySQL Insert DateTime
October 28, 2023 - To insert data into the DATETIME columns, you need to ensure that the datetime values are in the 'YYYY-MM-DD HH:MM:SS' format.
๐ŸŒ
MySQL
dev.mysql.com โ€บ doc โ€บ refman โ€บ 8.4 โ€บ en โ€บ date-and-time-type-syntax.html
MySQL :: MySQL 8.4 Reference Manual :: 13.2.1 Date and Time Data Type Syntax
A date and time combination. The supported range is '1000-01-01 00:00:00.000000' to '9999-12-31 23:59:59.499999'. MySQL displays DATETIME values in 'YYYY-MM-DD hh:mm:ss[.fraction]' format, but permits assignment of values to DATETIME columns using either strings or numbers.
๐ŸŒ
MetaCPAN
metacpan.org โ€บ pod โ€บ DateTime::Format::MySQL
DateTime::Format::MySQL - Parse and format MySQL dates and times - metacpan.org
This module understands the formats used by MySQL for its DATE, DATETIME, TIME, and TIMESTAMP data types.
๐ŸŒ
LearnSQL.com
learnsql.com โ€บ cookbook โ€บ how-to-change-datetime-formats-in-mysql
How to Change Datetime Formats in MySQL | LearnSQL.com
SELECT first_name, last_name, DATE_FORMAT(registration_datetime, '%a, %Y %M %e %H:%i:%s') AS format_registration_datetime FROM student_platform; ... In a MySQL database, the DATE_FORMAT() function allows you to display date and time data in a changed format.
๐ŸŒ
w3resource
w3resource.com โ€บ mysql โ€บ date-and-time-functions โ€บ mysql-date_format-function.php
MySQL DATE_FORMAT() function - w3resource
1 week ago - The following statement will format the specified datetime 2008-05-15 22:23:00 according to the format specifier %W %D %M %Y.
๐ŸŒ
DEV Community
dev.to โ€บ gbhorwood โ€บ mysql-getting-a-grip-on-dates-times-and-timezones-4anj
mysql: getting a grip on dates, times, and timezones - DEV Community
January 3, 2023 - DATE this is just the date with ... DATETIME is, as the name implies, the date plus the time. the format used is 'YYYY-MM-DD hh:mm:ss', however you can use decimal seconds here as well....
๐ŸŒ
MariaDB
mariadb.com โ€บ docs โ€บ server โ€บ reference โ€บ data-types โ€บ date-and-time-data-types โ€บ datetime
DATETIME | Server | MariaDB Documentation
January 28, 2026 - MariaDB displays DATETIME values in 'YYYY-MM-DD HH:MM:SS.ffffff' format, but allows assignment of values to DATETIME columns using either strings or numbers. For details, see date and time literals.
๐ŸŒ
MySQL Tutorial
mysqltutorial.org โ€บ home โ€บ mysql basics โ€บ mysql datetime data type
MySQL DATETIME Data Type
December 28, 2023 - MySQL uses 5 bytes to store a DATETIME value. In addition, a DATETIME value can include a trailing fractional second up to microseconds with the format YYYY-MM-DD HH:MM:SS[.fraction] e.g., 2015-12-20 10:01:00.999999.
๐ŸŒ
Reddit
reddit.com โ€บ r/php โ€บ why is there no php constant for the mysql date and datetime format?
r/PHP on Reddit: Why is there no PHP constant for the mysql date and datetime format?
December 8, 2016 - Because not every application uses MySQL. ... That would be a good reason, except that the vast majority of applications use some form of SQL, and Y-m-d H:i:s is the ANSI SQL standard datetime format, it's not unique to MySQL.
๐ŸŒ
DataCamp
datacamp.com โ€บ doc โ€บ mysql โ€บ mysql-date-format
MySQL DATE_FORMAT() Function: Usage & Examples
This formats the date as `Sunday, December 31, 2023`, showcasing the usage of format specifiers to display the full name of the day, month, and the day of the month.
๐ŸŒ
MySQL
dev.mysql.com โ€บ doc โ€บ mysql โ€บ en โ€บ date-and-time-types.html
MySQL :: MySQL 8.4 Reference Manual :: 13.2 Date and Time Data Types
Although MySQL tries to interpret values in several formats, date parts must always be given in year-month-day order (for example, '98-09-04'), rather than in the month-day-year or day-month-year orders commonly used elsewhere (for example, '09-04-98', '04-09-98').
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ mysql โ€บ mysql-insert-date-time
MySQL Insert Date Time - GeeksforGeeks
January 25, 2024 - DATETIME: It combines data and time format "YYYY-MM-DD HH:MM:SS". example - "2023-12-20 07:23:30". TIMESTAMP: Stores the time stamp format "YYYY-MM-DD HH:MM:SS TIMESTAMP". example - "1970-01-01 00:00:00 UTC".