MySQL - 如何更改使用 mediumtext 数据类型的日期格式?

MySQL - How do I change the format of a date which is using the mediumtext data type?

如何更改使用 mediumtext 数据类型的日期格式?我到处都找不到解决方案。

发件人:

+-------------+----------------------------+
|  Page Name  | Last Modified (mediumtext) |
+-------------+----------------------------+
| Page Name 1 | Jul 20, 2018 16:06         |
| Page Name 2 | Jun 04, 2019 11:16         |
| Page Name 3 | Sep 03, 2019 13:11         |
| Page Name 4 | Sep 19, 2019 14:00         |
| Page Name 5 | Dec 20, 2019 09:34         |
+-------------+----------------------------+

收件人:

+-------------+----------------------+
|  Page Name  | Last Modified (date) |
+-------------+----------------------+
| Page Name 1 | 2018-07-20           |
| Page Name 2 | 2019-06-04           |
| Page Name 3 | 2019-09-03           |
| Page Name 4 | 2019-09-19           |
| Page Name 5 | 2019-12-20           |
+-------------+----------------------+

Select 声明:

Select PageName, LastModDate from Content

我尝试使用下面的代码,但它们 return 为空。

- CONVERT(LastModDat, DATETIME)
- DATE_FORMAT(LastModDat, "%Y-%m-%d")

您可以在 MySQL 中使用 str_to_date():

select str_to_date(left(last_modified, 13), '%M %d, %Y')

这会产生一个 date 值。我不建议将其转换为字符串。