mysql哪些函数可以获取各种时间类型,下面编程教程网小编给大家介绍一下各种mysql函数!
获取当地具体日期和时间(年月日时分秒)
//方法一
select now() as time
//方法二
select LOCALTIME() as time
//方法三
select current_timestamp() as time
//方法四
select LOCALTIMESTAMP() as time
//方法五
select sysdate() as time
获取当地具体日期和时间(年月日)
//方法一
select curdate() as time
//方法二
select current_date() as time
获取具体的时间(时分秒)
//方法一
select curtime() as time
//方法二
select current_time() as
//方法三
select utc_time() as time
以上是编程学习网小编为您介绍的“mysql哪些函数可以获取各种时间类型”的全面内容,想了解更多关于 mysql 内容,请继续关注编程基础学习网。
沃梦达教程
本文标题为:mysql哪些函数可以获取各种时间类型
基础教程推荐
猜你喜欢
- 浅谈数据库优化方案 2024-02-16
- SQL Server之SELECT INTO 和 INSERT INTO SELECT案例详解 2024-02-13
- 详解Redis连接命令使用方法 2024-03-23
- Redis GEORADIUS命令 2024-04-06
- Mysql查看死锁与解除死锁的深入讲解 2024-02-14
- Redis配置项汇总 2024-04-04
- mysql时间字段默认设置为当前时间实例代码 2022-08-31
- 如何保障mysql和redis之间的数据一致性 2024-04-25
- MySQL索引优化之适合构建索引的几种情况详解 2023-12-29
- mysql服务启动却连接不上的解决方法 2023-12-08
