Jump to content

what for seconds??? pls help


jugaad

Recommended Posts

i am posting a small code, please let me know if i need to add seconds in this strings, how it gonna work? what is the right way to show here

 

(string)	$display_output = null;
(string) $minute = 60;
(string) $seconds = ?????????????????????????
(string) $hour = 60 * $minute;
(string) $day = 24 * $hour;

Link to comment
https://forums.phpfreaks.com/topic/135273-what-for-seconds-pls-help/
Share on other sites

here is code for more details: i am playing with seconds, and you can see second code there, but i know its not right, i am really new to this: Please help

 

function time_difference ($end_date, $start_date = CURRENT_TIME)
{
return ($end_date - $start_date);
}

function time_left($end_date, $start_date = CURRENT_TIME)
{
(string)	$display_output = null;
(string) $second = ??????????
(string) $minute = 60;
(string) $hour = 60 * $minute;
(string) $day = 24 * $hour;


$time_left = $end_date - $start_date;

$days_left = floor($time_left/$day);

$hours = $time_left - ($days_left * $day);
$hours_left = floor($hours/$hour);

$minutes = $hours - ($hours_left * $hour);
$minutes_left = floor($minutes/$minute);

$seconds = $minutes - ($minutes_left * $hour);
$seconds_left = floor($seconds/$second);

if ($time_left > 0)
{
	$display_output = (($days_left>0) ? '<span>'.$days_left . ' ' . (($days_left==1) ? GMSG_DAY : GMSG_DAYS) . ', ' : '<span class="redfont">') .
		(($hours_left>0 || $days_left>0) ? $hours_left . GMSG_H : '') . ' ' . $minutes_left . GMSG_M . ' ' . $seconds_left . GMSG_S . '</span>';
}
else
{
	$display_output = GMSG_CLOSED;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.