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>

 

posted @ 2017-05-26 10:08  sky20080101  阅读(112)  评论(0编辑  收藏  举报