How do I get the current date and time in PHP?

后端 未结 30 1605
孤城傲影
孤城傲影 2020-11-22 08:19

Which PHP function can return the current date/time?

30条回答
  •  感情败类
    2020-11-22 09:09

    If you want a different timescale, please use:

    $tomorrow  = mktime(0, 0, 0, date("m")  , date("d")+1, date("Y"));
    $lastmonth = mktime(0, 0, 0, date("m")-1, date("d"),   date("Y"));
    $nextyear  = mktime(0, 0, 0, date("m"),   date("d"),   date("Y")+1);
    
    date_default_timezone_set("Asia/Calcutta");
    echo date("Y/m/d H:i:s");
    

提交回复
热议问题