|
|
|
|
|
|
| |
| <?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");
?> | | |
|
| A Timing Class Categories : PHP, PHP Classes, Date Time | | | Finding the day of the week for a specific date.
Categories : PHP, Databases, MySQL, Date Time | | | A wrapper function to format dates coming from a databases with the
same syntax as PHP's date() function. Categories : Date Time, Databases, PHP | | | pcCalendar class - Allows for the creation of calendars in HTML pages. All output functions can be easily overridden, refer to article 1471 for an example.
Categories : PHP, Date Time, Calendar, PHP Classes | | | A PHP Calendar function with CSS : add a cool calendar to any php page by just adding a calendar class based function. Categories : PHP, PHP Classes, Calendar, Date Time | | | PHP Round Clock - Must have Gif support to use this. Categories : PHP, Date Time, Graphics | | | 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 | | | Open and Close your website in fixed times . Categories : PHP, PHP Classes, Cron, Date Time | | | mysql date/time converters Categories : PHP, MySQL, Databases, Date Time | | | 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 | | | If you want to create select buttons featuring current date this example will show you how... Categories : Date Time, HTML and PHP, PHP | | | Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example. Categories : PHP, Date Time, PHP Classes, Calendar | | | calculus of the eastersunday Categories : BC math, PHP, Date Time, Databases | | | Functions used to define a schedule of holidays. Can define non-fixed holidays (eg. 3rd sunday of June). Categories : Calendar, Date Time, PHP | | | Monthly and Daily Upcoming Events calendar. Categories : Date Time, PostgreSQL, PHP, Calendar, Databases | |
|
|
|