一、 日期相关函数
select current_date(); select current_date; select current_time; select current_timestamp; select date_add (current_timestamp(), interval 1 year); select date_add (current_timestamp(), interval 1 month); select date_sub (current_timestamp(), interval 1 year); select date_sub (current_timestamp(), interval 1 month); select datediff(current_timestamp(), date_add (current_timestamp(), interval 1 month ); select timediff('12:30:30', '18:30:30'); select now();select year(now()); select month(now());
二、流程控制函数
IF (expr1,expr2,expr3); select if (1 > 0, 'hello','see you'); IFNULL (expr1,expr2);select ifnull (null, 3 + 2); SELECT CASE WHEN expr1 then expr2 else expr3 end; select case when 10> 0;
三、其他函数
USER(); DATABASE(); MD5(str) ; PASSWORD(str );
相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!
推荐阅读:
以上就是JS的日期相关函数使用详解的详细内容,更多请关注php中文网其它相关文章!
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论