Answer the question
In order to leave comments, you need to log in
Display the remaining time in the form of a scale?
Good afternoon, tell me how to make the remaining time until the end of the announcement as on Avito in the form of a scale?
I get photo number 2 with this code.
$ost = floor((strtotime($row_Recordset1['data1'])-time())/(24*60*60));
if($ost>0)
echo '<br><font color=green>Осталось '.$ost.' дн.</font>';
elseif($ost==0)
echo '<br>Последний день';
elseif($ost<0)
{
if (!$row_Recordset1['activ'])
echo '<br><font color=red>Просрочено</font>';
elseif(!$row_Recordset1['moder'])
{
echo '<br><font color=orange>В архиве</font>';
Answer the question
In order to leave comments, you need to log in
Here is simple arithmetic, plus :
Your task is to substitute the total number of days instead, instead of substitute the number of remaining days. However, I would rather translate everything into percentages and output as percentages.
In addition, you can create a regular div, put another div in it and set its width in%, which is calculated according to your days. I think how to calculate the percentage of remaining days of the total you know.
Example: https://jsfiddle.net/oLnyzLc2/<progress>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question