Código fuente de 'Segundos desde 1970.php'
<?PHP
// Code created by Ben Sintay (me@bjsintay.com)
// Copyright 2003-05 RocketSense
// Grab POST variables
$m = $HTTP_POST_VARS['m'];
$d = $HTTP_POST_VARS['d'];
$y = $HTTP_POST_VARS['y'];
$hours = $HTTP_POST_VARS['hours'];
$min = $HTTP_POST_VARS['min'];
$timestamp = $HTTP_POST_VARS['timestamp'];
$Submit = $HTTP_POST_VARS['Submit'];
?>
<html>
<head>
<title>Time Stamp Calculator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<!--
copyright 2003-05 bj sintay and rocketsense.com
-->
<body>
<p align="center"><strong><font size="3" face="Courier New, Courier, mono">
Segundos desde 1970<br>
</font><font face="Courier New, Courier, mono" style="font-size: 9pt">Unix Time Stamp Calculator</font></strong></p>
<table width="80%" border="1" align="center" cellpadding="20" cellspacing="3" bgcolor="#CC0000">
<tr>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF">
<form name="form1" method="post" action="<?PHP print $_SERVER['PHP_SELF'];?>">
<p> <font face="Courier New, Courier, mono"> Fecha:
<input name="m" type="text" id="m" size="2" maxlength="2"> /
<input name="d" type="text" id="d" size="2" maxlength="2"> /
<input name="y" type="text" id="y" size="4" maxlength="4"> @
<input name="hours" type="text" id="m22" value="0" size="2" maxlength="2"> :
<input name="min" type="text" id="min" value="0" size="2" maxlength="2"> (24h:m) </font></p>
<p><font face="Courier New, Courier, mono">Segundos: </font>
<input type="text" name="timestamp"></p>
<p> <font face="Courier New, Courier, mono">
<input type="submit" name="Submit" value="Generar">
</font> </p>
</form>
</td>
</tr>
<tr>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF"><p>
<font face="Courier New, Courier, mono">Segundos desde 1970: <strong>
<?PHP
// Determine timestamp from date form fields (if date is entered, else display the entered timestamp)
if(($Submit) AND ($m)) echo mktime($hours,$min,0,$m,$d,$y);
else echo "$timestamp";
?>
</strong> </font></p>
<p><font face="Courier New, Courier, mono">Fecha: <strong>
<?PHP
// Determine date from timestamp if timestamp form field contains a value
if(($Submit) AND ($timestamp)){
// Form date variables
$m = date("m", $timestamp); // Month
$d = date("d", $timestamp); // Day
$y = date("y", $timestamp); // Year
$h = date("g", $timestamp); // Hours
$i = date("i", $timestamp); // Minutes
$a = date("a", $timestamp); // AM/PM
echo "$m / $d / $y @ $h:$i$a"; // Output
}
else{
echo "$m / $d / $y @ $hours:$min"; //Output
}
?>
</strong></font></p></td>
</tr>
</table>
<p align="center"><font size="1" face="Courier New, Courier, mono">Este código
fue descargado de: <a href="http://www.unixtimestamp.com">www.unixtimestamp.com</a>.</font></p>
<p align="center"> </p>
</body>
</html>