Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php函数的输出;strotime();他感到困惑_Php - Fatal编程技术网

php函数的输出;strotime();他感到困惑

php函数的输出;strotime();他感到困惑,php,Php,我不知道这个函数的输出 strottime(日期(“j”)、日期(“F”)、日期(“t”) 产出:1475734243 输出随时间而变化 我的代码块是: <?php $day= date("j"); $month= date("F"); $year= date("Y"); //calendar Variables $currentTimeStamp= strtotime($day-$month-$year); echo $curre

我不知道这个函数的输出

strottime(日期(“j”)、日期(“F”)、日期(“t”)

产出:1475734243

输出随时间而变化

我的代码块是:

<?php
    $day= date("j");
    $month= date("F");
    $year=  date("Y");


    //calendar Variables
    $currentTimeStamp=  strtotime($day-$month-$year);

    echo $currentTimeStamp;

    ?>

日期(“j”)给出了一个月中没有前导零(1到31)的日子。 日期(“F”)给出了一个月的完整文本表示,如一月或三月。
日期(“Y”)给出一年的完整数字表示,4位数字(例如:2016)。

输出为unix时间戳

echo$day.'-'.$month.'-'.$year

echo日期('j-F-Y',strotime($currentTimeStamp))

这将为您提供所需的答案。

请参阅


它返回从U日(1970年1月1日00:00:00 UTC)到作为参数提供的日期(以字符串表示)经过的秒数。它也被称为“Unix时间戳”和“Unix纪元(时间)”

我不确定哪一部分容易混淆,但如果我正确地认为您希望使用该格式显示当前日期,那么您应该使用它,而不必使用strotime()

样本工作输出:

问题是什么?那么,实际问题是什么而strotime的文档中哪一部分令人困惑呢?strotime将您的日期格式(如“2016年3月31日”)转换为unix时间(整数),这更干净。
echo date("j F Y");