没有给我看今天的日期


Not showing me the todays date

<?php   
        for ( $i=1; $i<13; $i++ ) {
        $month = date('m', mktime(0,0,0,$i,2,2000));
        $sel = ( $i == date('n') ? ' selected="selected"' : '');
        $options1[] = "<option  value='"{$month}'" {$sel}>{$month}</option>";
}
        $options_list1 = join("", $options1);
        echo "<select name='"month'" >{$options_list1}</select>";
        for ( $j=1; $j<32; $j++ ) {
        $theday = date('d', mktime(0,0,0,0,$j,2000));
        $sel = ( $j == date('d') ? ' selected="selected"' : '');
        $options2[] = "<option  value='"{$theday}'" {$sel}>{$theday}</option>";
}
        $options_list2 = join("'r'n", $options2);
        echo "<select name='"day'" >{$options_list2}</select>";
      for ( $k=1960; $k<2016; $k++ ) {
      $theyear = date('Y', mktime(0,0,0,1,1,$k));
       $sel1 = ( $k == date("Y") ? ' selected="selected"' : '');
        $options3[] = "<option  value='"{$theyear}'" {$sel1}>{$theyear}</option>";
}
        $options_list3 = join("'r'n", $options3);
        echo "<select name='"year'" >{$options_list3}</select>";
        ?>

这是日期,月份和年份的下拉列表。它显示今天的月份和年份,但在它显示我昨天的日期中,例如今天的日期是 9/22/2013 和它显示我 9/21/2013 .我做错了什么?

您需要

使用date_default_timezone_set设置时区php.ini

PHP手册