Php Group purchase notes

Source: Internet
Author: User
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 ';
}
}



?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.