MySQL日期函数sysdate()与now()的区别,获取当前时间,日期相关函数

sql 复制代码
select sleep(2) as datetime
union all	
select sysdate()  -- sysdate() 返回的时间是当前的系统时间,而 now() 返回的是当前的会话时间。
union all	
select now()   -- 等价于  localtime,localtime(),localtimestamp,localtimestamp(),current_timestamp,current_timestamp()
union all	
select concat(curdate(),' ',curtime())
union all	
select concat(date(now()),' ',time(now()))
union all	
select concat(year(now()),'-',month(now()),'-',day(now()),' ',hour(now()),':',minute(now()),':',second(now()))
union all 	
select dayname(now())
union all 	
select monthname(now());
相关推荐
2401_8470565513 分钟前
Altium Designer脚本工具定制
网络·数据库
神仙别闹23 分钟前
基于Python+SQLite的课程管理系统
数据库·sqlite
掐指一算乀缺钱26 分钟前
SpringBoot 数据库表结构文档生成
java·数据库·spring boot·后端·spring
少年负剑去1 小时前
django分发路由
数据库·django·sqlite
飞翔的佩奇1 小时前
xxl-job适配sqlite本地数据库及mysql数据库。可根据配置指定使用哪种数据库。
数据库·spring boot·mysql·sqlite·xxl-job·任务调度
吱吱鼠叔1 小时前
MATLAB数据文件读写:1.格式化读写文件
前端·数据库·matlab
小哇6661 小时前
spring-TransactionTemplate 编程式事务
数据库·spring
如意机反光镜裸2 小时前
CentOS7安装MySQL教程
数据库·mysql
冰镇毛衣2 小时前
1.4 MySql配置文件
数据库·mysql
攻城狮的梦2 小时前
redis集群模式连接
数据库·redis·缓存