MYSQL 获取当前时间 年月日
时间: 2023-08-24 16:11:23 浏览: 175
要获取当前时间的年月日,你可以使用以下查询语句:
SELECT YEAR(NOW()) as year, MONTH(NOW()) as month, DAY(NOW()) as day;
这个查询语句将返回当前时间的年份、月份和日期。你可以将NOW()函数替换为具体的日期时间值,以获取该日期时间的年月日。
#### 引用[.reference_title]
- *1* *2* [【数据库Mysql 查询当前时间,年月日】](https://blog.csdn.net/qq_41915325/article/details/126876980)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [MySQL 获取某个时间的年月日小时的函数](https://blog.csdn.net/weixin_42599908/article/details/129609403)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文