#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######28###29 30 31 32 33 34 35 |
#<?php
#
date_default_timezone_set( 'PRC' );
# # ## # ##
# echo date ("Y-m-d H:i:s"), ;######### ######### ######// 日期天數相加函數####### echo #日期 ( 'Y-m-d' ##, strtotime ( '+1 天' , strtotime ( '2016 - 09-12' ))), "\n\n" ;
# echo #strtotime ( '2016-09-12' ), "\n" ;
echo #日期 ( "Y-m-d" , ' 1473609600' ), "\n" ;
echo date ( "Y-m-d" , ' 1573609600' ), "\n" ;
### ##### #// 日期天數相加函數####### $d #= "2016-09-12 10:12:20" ;
echo date ( "Y-m-d" , strtotime ( "$d +1 day" )), "\n\n" ;
function date2time( $d ){
##
## ##
## #$year=((int) ###substr#######(######"$d"#######,0, 4)); ######//取得年份####### $month =((int) substr ( "$d" ,5,2));
# $day =( (int) substr ( "$d" ,8,2));
return #mktime (0,0,0, #$月 #, $日 , $年 );
#}
echo #date2time( "2016-09-12" #), #" \ n\n" ;
## $date_1
## “2066-09-12” ;
$date_2 = "2016-09-12" ;
# $Date_List_a1 = 爆炸 ##( "-" , $date_1 ); #
$Date_List_a2 = 爆炸 ( ##"-"
##( ##"-" , ###$date_2######);###### $d1 = mktime (0,0,0, #$Date_List_a1 [1], $Date_List_a1 [2], $Date_List_a1 [0]);
$d2 = mktime (0,0,0, #$Date_List_a2 [1], $Date_List_a2 [2], $Date_List_a2 [0]);
$天 = 輪 (( $d1
################################### -######$d2######)/3600/24);############ ######echo#### ###"$date_2 -> $date_1 外: $Days 天"######, ######"\n"######;######?<p style="margin-top:10px;margin-bottom:10px;color:rgb(51,51,51);">執行結果:</p><p class="syntaxhighlighter bash" style="margin:1em 0px;font-size:1em;"><br/></p><table border="0" style="background:none;border:0px;float:none;margin:0px;padding:0px;vertical-align:baseline;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;font-size:1em;min-height:auto;"><tbody style="background:none;float:none;margin:0px;padding:0px;vertical-align:baseline;font-size:1em;min-height:auto;"><tr style="background:none;border-top:0px;float:none;margin:0px;padding:0px;vertical-align:baseline;font-size:1em;min-height:auto;" class="firstRow"><td class="gutter" style="vertical-align:baseline;background:none;border-width:0px;float:none;margin:0px;padding:0px;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;font-size:1em;min-height:auto;color:rgb(175,175,175);"><p class="line number1 index0 alt2" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;">#1</p><p class="line number2 index1 alt1" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;">2</p><p class="line number3 index2 alt2" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;">3</p><p class="line number4 index3 alt1" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;">4</p><p class="line number5 index4 alt2" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;">5</p><p class="line number6 index5 alt1" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;">6</p><p class="line number7 index6 alt2" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;">7</p><p class="line number8 index7 alt1" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;">#8</p><p class="line number9 index8 alt2" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;">9</p>##10<p class="line number10 index9 alt1" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;"> </p>11<p class="line number11 index10 alt2" style="background-image:none;border-width:0px 3px 0px 0px;border-right-style:solid;border-right-color:rgb(108,226,108);float:none;margin:0px;padding:0px .5em 0px 1em;text-align:right;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;"></p></td><td class="code" style="vertical-align:baseline;background:none;border-width:0px;float:none;margin:0px;padding:0px;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;font-size:1em;min-height:auto;"><p class="container" style="background:none;border:0px;float:none;margin:0px;padding:0px;vertical-align:baseline;font-size:1em;min-height:auto;"><br/>#<p class="line number1 index0 alt2" style="background-image:none;border:0px;float:none;margin:0px;padding:0px 1em;vertical-align:baseline;font-size:1em;min-height:auto;white-space:pre;"><code class="bash plain" style="font-size:1em;font-family:Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;background:none;border:0px;float:none;margin:0px;padding:0px;vertical-align:baseline;min-height:auto;color:#000000;">2017-11-06 19:13:02
#2016-09-13 ## #1473609600
2016-09-12
2019-11-13
#2016- 09-13
1473609600
2066-09-12 -> 2016- 09-12 相差: 18262 天
|