php 时间转化总结
2024-08-25 02:52:17
iQuery插件datepicker获取的时间函数为"月月/天天/年年年年"(以04/21/2015为例)的形式
(1)转化为2015-21-04形式:$start = date('Y-m-d',strtotime($start1));
(2)计算两个时间所差天数:$days=floor((strtotime($end)-strtotime($start))/86400);
(3)求所求日期的下一天:$nextday=date("Y-m-d",strtotime("$tday +1 day"));
(4)求所求日期的一周后:$nextweekday=date("Y-m-d",strtotime("$tday+1 week"));
(5)求下个星期二:date("Y-m-d",strtotime("next Thursday"));
(6)上个周一: date("Y-m-d",strtotime("last Monday"));
(7)一个月前: date("Y-m-d",strtotime("last month"));
(8)一个月后: date("Y-m-d",strtotime("+1 month"));
最新文章
- SweetAlert – 替代 Alert 的漂亮的提示效果
- CentOS 7下的 Mysql 主从配置
- Spark源码学习1.1——DAGScheduler.scala
- 论文阅读之 A Convex Optimization Framework for Active Learning
- ckeditor
- spring注解:@PostConstruct和@PreDestroy
- 怎样成为PHP 方向的一个合格的架构师
- bootstrap注意事项(一)
- cookie程序设计举例
- 【转】Android内存机制分析1——了解Android堆和栈
- This application failed to start because it could not find or load the Qt platform plugin ";windows"; 的问题原因以及解决方案
- Spring boot中自动编译配置
- Linux 下磁盘挂载
- Mybatis的延迟加载和缓存
- Dubbo服务超时
- Python爬虫项目--爬取某宝男装信息
- maven打包到私服,打的是war包,好郁闷
- SQL SERVER解析Json
- poj1273
- Linux buffer/cache异同