|
|
|
<?
function GetTimeStamp($MySqlDate)
{
/*
Take a date in yyyy-mm-dd format and return it to the user
in a PHP timestamp
Robin 06/10/1999
*/
$date_array = explode("-",$MySqlDate); // split the array
$var_year = $date_array[0];
$var_month = $date_array[1];
$var_day = $date_array[2];
$var_timestamp = mktime(0,0,0,$var_month,$var_day,$var_year);
return($var_timestamp); // return it to the user
}
function GetDayDiff($ts_1, $ts_2)
{
/*
This will return the difference in days between two PHP timestamps
Robin 06/10/1999
*/
// calculate which is the larger so we never get negative answers
if ($ts_1 > $ts_2) {
// $ts_1 is larger
$var_days = ($ts_1 - $ts_2) / 86400; /// 60 / 60 / 24;
} elseif ($ts_1 < $ts_2) {
// $ts_1 is smaller
$var_days = ($ts_2 - $ts_1) / 86400; /// 60 / 60 / 24;
} else {
// they must be equal
$var_days = 0;
}
return($var_days); //return the value
}
?>
source : http://www.xs.mw/robin/php.html |
|
| Calendar using Date function Categories : HTML and PHP, PHP, Date Time, Calendar | | | phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install. Categories : PHP, Complete Programs, HTML and PHP, MySQL | | | Select with current month Categories : PHP, HTML and PHP, Date Time, Arrays | | | html split bar used to split in multiple pages a database result Categories : HTML and PHP, Databases, MySQL, PHP | | | Automatically printing the contents of an sql table in MySQL. Categories : MySQL, PHP, HTML and PHP, Databases | | | Random quote generator using MySQL and PHP. Allows HTML tags inside quotes and
features a marker so a sigle quote will not be repeated after consecutive page
loads.
Categories : PHP, HTML and PHP, MySQL | | | Amazon book cover handling Categories : HTML and PHP, PHP, MySQL, Ecommerce | | | Complete, simple working example of login screen and check on a unique page using php functions, cookies and mysql database. Categories : PHP, Cookies, MySQL, HTML and PHP, Authentication | | | Pull Down Surfing - Surf on Change Categories : Java Script, MySQL, HTML and PHP, PHP, Databases | | | Dynamically generated pop-ups (Select items) Categories : PHP, HTML and PHP, MySQL, Databases | | | a function that builds an HTML select list from any mysql table. Categories : PHP, MySQL, HTML and PHP | | | Message of the Day - Random Message (Needs MySQL!) Categories : Databases, HTML and PHP, PHP, MySQL | | | Alternating background color for HTML table rows Categories : PHP, Databases, MySQL, HTML and PHP | | | A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL | | | Creates three SELECT form fields: Month, Day, and Year. You give it a string which will be used to make the name for the three fields, and a number of seconds to use as the default date. If you give it blank for this value, the current date is used. Categories : HTML and PHP, PHP, Date Time | |
|
|
|