Código fuente de 'Segundos desde 1970.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'];

<title>Time Stamp Calculator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
copyright 2003-05 bj sintay and rocketsense.com
<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">
    <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>
    <td bordercolor="#CCCCCC" bgcolor="#FFFFFF"><p>
	<font face="Courier New, Courier, mono">Segundos desde 1970: <strong> 
		// 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> 
		// 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
			echo "$m / $d / $y @ $hours:$min";	//Output
<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">&nbsp;</p>