Php Group buying countdown code & lt ;? Php $ astrtotime (date (Y-m-dH: I: s); $ a & nbsp; strtotime (date (& nbsp; 17:50:51 )); custom Time $ B $ a + 24*3600; timestamp value after 24 hours $ d $ a php Group buying countdown code
Php Group buying countdown code
// $ A = strtotime (date ("Y-m-d H: I: s "));
$ A = strtotime (date ("17:50:51"); // custom time
$ B = $ a + 24*3600; // The timestamp value after 24 hours
$ D = $ A-24 * 3600; // The timestamp value 24 hours ago
Echo date ("Y-m-d H: I: s", $ B); // 24 hours later
Echo"
";
Echo date ("Y-m-d H: I: s", $ d); // 24 hours ago
Echo"
";
$ C = mktime (); // Current timestamp value
Echo date ("Y-m-d H: I: s"); // current time
Echo"
";
Echo $ c; // Current timestamp value
Echo"
";
Echo (strtotime ("+ 5 hours"); // The timestamp value after 5 hours
Echo"
";
$ F = $ B-$ c;
Echo strtotime (date ("Y-m-d H: I: s", $ f); // The remaining timestamp after 24 hours. (Seconds)
Echo"
";
/// $ Days;
// $ Hours;
// $ Minute;
// $ Second;
$ Seconds = $ f;
// $ Seconds = 3722;
$ Second = $ seconds % 60;
$ Minute = (int) ($ seconds/60 );
// $ Minute = var_dump (int) ($ seconds/60); test code
// Echo $ minute;
// Echo (int) $ chushu;
$ Minutes = $ minute % 60;
$ Hours = (int) ($ minute/60 );
If ($ seconds> 60 ){
If ($ minute> 60 ){
Echo 'remaining Time :';
Echo $ hours. 'hour '. $ minutes. 'Minute'. $ second. 'second ';
}
Else {
Echo $ minutes. 'Minute '. $ second. 'second ';
}
} Else {
If ($ f <= 0) {echo 'You can vote ';}
Else {
Echo $ seconds. 'second ';
}
}
?>