简单的php奥运倒计时牌
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 |
1 <?php 2 3 date_default_timezone_set ( "Asia/Shanghai"
); 4 $kaimu
= mktime
( 4, 0, 0, 07, 28, 2012 ); 5 //echo date ( "Y-m-d H:i:s", $kaimu ); 6 //echo "<br/>"; 7 //echo date ( "Y-m-d H:i:s", time () ); 8 $timecha
= $kaimu - time (); 9 10 mkdaojishi ( $timecha
); 11 function
mkdaojishi( $timecha ) { 12 $miao
= $timecha
% 60; 13 $fen
= floor ( $timecha
/ 60 ); 14 15 if
( $fen > 60) { 16 $shi
= floor ( $fen / 60 ); 17 $fen = $fen %60; 18 } 19 20 if
( $miao <10){ $miao = "0" . $miao ;} 21 if
( $fen <10){ $fen = "0" . $fen ;} 22 if
( $shi <10){ $shi = "0" . $shi ;} 23 $dangqian = date ( "Y-m-d H:i:s" ,time()); 24 echo
"当前时间:$dangqian,<b>距伦敦奥运会开幕还有:<font color=‘red‘>$shi:$fen:$miao</font></b>" ; 25 } 26 27 ?> |
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。