这次给大家带来js的日期相关函数使用详解,使用js日期相关函数的注意事项有哪些,下面就是实战案例,一起来看一下。
一、 日期相关函数
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中文网其它相关文章!
推荐阅读:
企业在线记账管理系统是一款功能强大,特别简单易用的财务在线记账软件,它不需要用户了解深奥的财务知识,不用培训即会使用,特别适合中小企业,门店等用在日常经营管理中来管理现金流水账,应收应付帐,以及公司记账等相关财务活动。 环保时代企业在线记账管理系统也可以说是一款傻瓜型的流水账管理系统,通过记录每日现金支出,收入的明细账,为企业管理者提供详细的收入支出日报,月报,欠款明细等重要信息。是您进行企业管
773
以上就是JS的日期相关函数使用详解的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号