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 : Time Format Conversion
Categories : PHP, Date Time Click here to Update Your Picture
Saravanan .R
Date : Oct 30th 2004
Grade : 3 of 5 (graded 7 times)
Viewed : 4593
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Saravanan .R
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php
/*
*    Function Name : timeConversion()
*    Author Name: Saravanan.R
*    Version: 1.0
*    Email: saravanan.r@gmail.com
*    Description : To Convert the seconds into TIME FORMAT.
*    Parameters Description:
*    -----------------------
*        a. $gvnSeconds - seconds to convert
*   
*    Returns : Time ( HH:MM:SS )
*    If any problems with this function script, feel free to report with error message.
*    @ : saravanan.r@gmail.com
*   
*/
function timeConversion($gvnSeconds)
{
   
$hrs = (int) ( $gvnSeconds / 3600 ) ;
   
$mins = (int) ( ($gvnSeconds/60) - ( $hrs * 60 ) ) ;
   
$secs = (int) ( $gvnSeconds % 60 ) ;
   
   
$daily = $hrs . ":" . $mins . ":" . $secs  ;   
   
    return
$daily ;
}


/*
*    Function Name : weeklyConversion()
*    Author Name: Saravanan.R
*    Version: 1.0
*    Email: saravanan.r@gmail.com
*    Description : To Convert the seconds into TIME FORMAT.
*    Parameters Description:
*    -----------------------
*        a. $gvnSeconds - seconds to convert
*   
*    Returns : Time ( DAY HH:MM:SS Friday 8:36:30 )
*    If any problems with this function script, feel free to report with error message.
*    @ : saravanan.r@gmail.com
*   
*/
function  weeklyTimeConversion($gvnSeconds)
{
   
$day = $gvnSeconds / 86400;

    switch ((INT)
$day)
    {
        case
0:
               
$days = "Sunday" ;
                break;
        case
1:   
               
$days = "Monday" ;
                break;
        case
2:   
               
$days = "Tuesday" ;
                break;
        case
3:   
               
$days = "Wednesday" ;
                break;
        case
4:   
               
$days = "Thursday" ;
                break;
        case
5:   
               
$days = "Friday" ;
                break;
        case
6:   
               
$days = "Saturday" ;
                break;
    }

   
$hrs = ( $gvnSeconds - ((int)$day * 86400)) / 3600   ;
   
$mins = ( $gvnSeconds - ((int)$hrs * 3600) - ((int)$day * 86400 ))/ 60 ;
   
$secs = ( $gvnSeconds - ((int)$mins * 60 ) - ((int)$hrs * 3600) - ((int)$day * 86400 ));

   
$weekly = $days . " " . (int)$hrs . ":". (int)$mins . ":" . (int)$secs ;

    return 
$weekly ;
}

   
// Output On : Sunday 10:10:00
   
echo " On : " . weeklyTimeConversion("36600");

   
// Output Daily @ 20:10:00
   
echo " Daily @ : " . timeConversion("72600");

?>



Simple function to return the number of days in a time span between 2 given dates.
Categories : PHP, Date Time, MySQL, Databases
PHP Round Clock - Must have Gif support to use this.
Categories : PHP, Date Time, Graphics
Bs_StopWatch is a class to measure time intervals in microseconds.
Categories : PHP, Date Time, PHP Classes
Calendars to choose a range of dates , reservation events ...
Categories : PHP, Calendar, Java Script, Date Time
A simple and fast calendar combining PHP and tables. Use this as a base for applications in which a calendar is needed.
Categories : Date Time, PHP, Complete Programs, Calendar
Simple conversion functions to change MySQL dates to arrays, arrays to MySQL dates.
Categories : PHP, Arrays, Date Time, Databases, MySQL
Change the background color of a website daily dynamically using the php date function to get the current day of the week and depending on that day, set the background color for the web page.
Categories : PHP, Date Time, Beginner Guides, Web Design
Count Number Of weeks in Month
Categories : PHP, Date Time, Beginner Guides
Customizable Calendar Class
Categories : HTML and PHP, Date Time, PHP, PHP Classes, Calendar
time() function with microseconds
Categories : Date Time, PHP
checkdate -- Validate a gregorian date/time
Categories : PHP, PHP Functions, Date Time
PHP Calendar Web App
Categories : PHP, Databases, MySQL, Date Time, Calendar
PHP Calendar
Categories : PHP, Calendar, Date Time, Java Script, CSS
Functions used to define a schedule of holidays. Can define non-fixed holidays (eg. 3rd sunday of June).
Categories : Calendar, Date Time, PHP
formating MySQL Timestamp to get a propper Output. related : Timestamp, ereg_replace, mysql, substr
Categories : MySQL, PHP, Date Time, Databases