WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Convert date's in YYYY-MM-DD (i.e. mysql format) into PHP3 timestamps. Also Find the difference in days between two PHP3 timestamps.
Categories : HTML and PHP, PHP, MySQL, Date Time Update Picture
Robin M.
Date : Oct 06th 1999
Grade : 2 of 5 (graded 6 times)
Viewed : 78915
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Robin M.
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?
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



Website colour changer
Categories : PHP, HTML and PHP, Date Time
mysql date/time converters
Categories : PHP, MySQL, Databases, Date Time
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
Functions for loading images into a MySQL database and displaying them.
Categories : Graphics, HTML and PHP, MySQL, PHP, Databases
PHP mySQL learning example This is a complete program to modify tables in a mySQL database on a nice and neat way.
Categories : PHP, MySQL, Complete Programs, HTML and PHP
formating MySQL Timestamp to get a propper Output. related : Timestamp, ereg_replace, mysql, substr
Categories : MySQL, PHP, Date Time, Databases
Phorum, MySQL, Language, UK date format, MySQL UK Date format
Categories : PHP, Date Time, Strings, MySQL, Databases
Amazon book cover handling
Categories : HTML and PHP, PHP, MySQL, Ecommerce
Convert MYSQL timestamp (14) fields back to UNIX epoch (seconds) format for display with the date() function. "revertTimeStamp($timestamp)"
Categories : PHP, Date Time, MySQL
If you want to create select buttons featuring current date this example will show you how...
Categories : Date Time, HTML and PHP, PHP
Count how many weeks in the month have a specified day, such as Mon, Tue, etc. Var avail - number of days - first day name of the month, occurrences of Sun, occurrences of Mon, etc. Allows you to calculate number of working hours exclude Holidays.
Categories : Calendar, Date Time, PHP, Databases, MySQL
a function that builds an HTML select list from any mysql table.
Categories : PHP, MySQL, HTML and PHP
A PHP useradmin for MySQL. Uploading is easy. The only thing you need is PHP and MySQL installed!
Categories : MySQL, Databases, PHP, HTML and PHP
Simple PHP control CSS Calendar
Categories : PHP, HTML and PHP, Calendar, Date Time, CSS
Complex paging with no resultset limit
Categories : PHP, MySQL, Databases, Output Control, HTML and PHP