A
A
Arthur2014-11-24 13:27:31
PHP
Arthur, 2014-11-24 13:27:31

How to correctly count the time from the given one?

hello! I have a question, I went through the ways, I can’t figure out how to display the time of the form: “24 hours left”, and not a dry date, while these 24 hours decrease to 0. Please help, I will be grateful.

$ddel = time() + 60*60*24;
$dadd = time();
$db->Query("SELECT COUNT(*) FROM db_bonus_list WHERE user_id = '$usid' AND date_del > '$dadd'");

<center><b style="color: rgb(160, 178, 178);">До след бонуса осталось: <?=date($data_bonus["date_del"],"H:i:s") ;?> </b></center>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Misha7, 2014-11-24
@arturka_v_10

You can't do this in php. This is done in javascript and jquery. It's better to use a plugin.
postovoy.net/33.html

F
Facetrollex, 2014-11-24
@Facetrollex

$ddel you store somewhere.

.................
.................
$h = $ddel - $dadd;
echo 'До след бонуса осталось:' . ceil($h/3600);

A
Artur, 2014-11-24
@arturka_v_10

You need to make a countdown - 1 hour (well, or ddel - dadd) so that it works and is displayed in the H: i: s format - I can’t set it up; it only works in hexadecimal when (H: i: s) gets up and does not move. how easy is it to release?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question