date

<?php
#$a=getdate();
#var_dump($a);
?>
<form method="post" action="">
    &nbsp;&nbsp;comment:<input type="text" name="comment"><br>
    timestamp:<input type="text" name="timestamp"><br>
    <input type="submit">
</form>
<hr>
<?php
if(isset($_POST["timestamp"]))
{
    echo $_POST["timestamp"] . '<br>';
    if(isset($_POST["comment"]))
    {
        echo $_POST["comment"]. '<br>';
    }   
    $a=getdate($_POST["timestamp"]);
    $hour=$a['hours']+8;
    echo "{$a['year']}-{$a['mon']}-{$a['mday']} {$hour}:{$a['minutes']}:{$a['seconds']}";
}
?>
<hr>
<a href="date.php" target="_blank">new page</a>
原文地址:https://www.cnblogs.com/sky20080101/p/6907148.html