zoukankan      html  css  js  c++  java
  • php 时间转化总结

    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"));

  • 相关阅读:
    小数的进制转换
    水题 O
    水题 J
    水题T,二进制转16进制
    水题B
    水题C
    HDU 2042
    HDU 2041
    Index For SQL Server
    Learning Note For Angular
  • 原文地址:https://www.cnblogs.com/nolonely/p/4443686.html
Copyright © 2011-2022 走看看