Quote of the day : "Computers are like air-conditioners, they stop working properly when you open windows." Swedish proverb

Next quote in 1.5 hours. [suggest a quote]

Timestamp to date

This script converts a Unix timestamp to a human-readable date (formatted as Day, dd Mon yyyy hh:mm:ss +xxxx).

The script in action

Timestamp 456733800 is Fri, 22 Jun 1984 08:30:00 +0200
 :

The source

<?php
if(!isset($_POST["tmstp"]))$tmstp=456733800;
else $tmstp=intval($_POST["tmstp"]);
echo 'Timestamp '.$tmstp.' is '.date("r",$tmstp).'<br/>
<form action="'.$_SERVER["PHP_SELF"].'" method="post"><div>
<label for="tmstp">Timestamp</label>&nbsp;: <input type="text" name="tmstp" id="tmstp" size="10" value="'.$tmstp.'" />
<input type="submit" value="Convert" /></div>
</form>';
?>
Comments :
No comments yet
[Add a comment]