I was breaking my head on how to figure out what date was this.??
well it turns out that this information was inserted into mysql table database using PHP time() function. When you display the time() function, it will display a long number. try this sample:
Code:
<php
echo time();
?>
echo time();
?>
If you run this short script, it will display something like this:
Code:
1151348975
* NOTE: when you run the script it will show a different number than my example here because its abviously a different time
From what i've learn about this handy function it some number in seconds. I haven't figure out much more than that.
But i wrote a little script that that show you how you can find out how much time as past in years, months, weeks, days, hours and seconds from a time stamp.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Seach Time Stamp Script By Wallpaperama.com</title>
</head>
<body>
<div align="center">
<h1>SEARCH TIME STAMP by <a href="http://www.wallpaperama.com">Wallpaperama.com</a></h1>
</div>
<?
function search($session_time)
{
//$session_time ="1151348975";
echo"You Entered: $session_time <BR>";
echo"The Current Time is = ".time()."<BR>";
$time_difference = time() - $session_time ;
echo"time_difference = ".$time_difference."<HR>";
$seconds = $time_difference ;
$minutes = round($time_difference / 60 );
$hours = round($time_difference / 3600 );
$days = round($time_difference / 86400 );
$weeks = round($time_difference / 604800 );
$months = round($time_difference / 2419200 );
$years = round($time_difference / 29030400 );
echo"seconds: $seconds<br>";
echo"minutes: $minutes<br>";
echo"hours: $hours<br>";
echo"days: $days<br>";
echo"weeks: $weeks<br>";
echo"months: $months<br>";
echo"years: $years<br>";
}
if($_POST['session_time'])
{
echo search($_POST['session_time']);
echo'<div align="center"><p><a href="'.$_SERVER['REQUEST_URI'].'">Click Here To Search Again</a></p></div>';
}
else
{
?>
<div align="center">
<form name="form1" method="post" action="">
<p>Seach:
<input name="session_time" type="text" size="35"><br>
<em>example:
1151348975
</em></p>
<p>
<input type="submit" name="Search" value="Search">
</p>
</form>
</div>
<?
}
?>
<p> </p>
<p align="center">This script was created from support from <a href="http://www.webune.com">Webune.com</a> Web Hosting. </p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Seach Time Stamp Script By Wallpaperama.com</title>
</head>
<body>
<div align="center">
<h1>SEARCH TIME STAMP by <a href="http://www.wallpaperama.com">Wallpaperama.com</a></h1>
</div>
<?
function search($session_time)
{
//$session_time ="1151348975";
echo"You Entered: $session_time <BR>";
echo"The Current Time is = ".time()."<BR>";
$time_difference = time() - $session_time ;
echo"time_difference = ".$time_difference."<HR>";
$seconds = $time_difference ;
$minutes = round($time_difference / 60 );
$hours = round($time_difference / 3600 );
$days = round($time_difference / 86400 );
$weeks = round($time_difference / 604800 );
$months = round($time_difference / 2419200 );
$years = round($time_difference / 29030400 );
echo"seconds: $seconds<br>";
echo"minutes: $minutes<br>";
echo"hours: $hours<br>";
echo"days: $days<br>";
echo"weeks: $weeks<br>";
echo"months: $months<br>";
echo"years: $years<br>";
}
if($_POST['session_time'])
{
echo search($_POST['session_time']);
echo'<div align="center"><p><a href="'.$_SERVER['REQUEST_URI'].'">Click Here To Search Again</a></p></div>';
}
else
{
?>
<div align="center">
<form name="form1" method="post" action="">
<p>Seach:
<input name="session_time" type="text" size="35"><br>
<em>example:
1151348975
</em></p>
<p>
<input type="submit" name="Search" value="Search">
</p>
</form>
</div>
<?
}
?>
<p> </p>
<p align="center">This script was created from support from <a href="http://www.webune.com">Webune.com</a> Web Hosting. </p>
</body>
</html>
To see this script in action, open your text editor, if you are using windows, you can use notepad, copy and paste this code into notepad and save it as session_time.php and upload to a site that has PHP. IF YOU DON"T HAVE A PHP SITE, VISIT OUR FRIENDS AT WWW.WEBUNE.COM AND SIGN UP WITH ONE OF THEIR PHP WEB HOSTING PLANS.
Once you have uploaded the session_time.php to your website, open it with your browser and you will get a search bar, enter the time stamp and it will tell you how many secons minutes hours days weeks months and years have passed.
NOTE: this is a very basic script, its only purpose is to show you how you can use the time() PHP function on your script to insert data into your mysql database using the time() function on your PHP scripts.
Hope this helps. If anyone has any other useful information about this, please provide by replying to this post. thanks.
you can visit http://www.php.net/manual/en/function.time.php for more info on this function: this is what they said:
time
(PHP 4, PHP 5)
time — Return current Unix timestamp
Description
int time ( void )
Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).
Examples
Code:
<?php
$nextWeek = time() + (7 * 24 * 60 * 60);
// 7 days; 24 hours; 60 mins; 60secs
echo 'Now: '. date('Y-m-d') ."\n";
echo 'Next Week: '. date('Y-m-d', $nextWeek) ."\n";
// or using strtotime():
echo 'Next Week: '. date('Y-m-d', strtotime('+1 week')) ."\n";
?>
$nextWeek = time() + (7 * 24 * 60 * 60);
// 7 days; 24 hours; 60 mins; 60secs
echo 'Now: '. date('Y-m-d') ."\n";
echo 'Next Week: '. date('Y-m-d', $nextWeek) ."\n";
// or using strtotime():
echo 'Next Week: '. date('Y-m-d', strtotime('+1 week')) ."\n";
?>