全部博文(1144)
分类: LINUX
2006-12-07 10:44:49
代码: |
function Date2stamp($dateStr){ list($dateStr,$null) = split(',',$dateStr); if ($null !="" ) $dateStr = $null; $dateStr = trim($dateStr); list($day,$month,$year,$time,$gmt ) = split(' ',$dateStr,5); // print $day."|".$month."|".$year."|".$time."|".$gmt; $month = strtolower($month); $monthof = array( 'jan'=>1, 'feb'=>2, 'mar'=>3, 'apr'=>4, 'may'=>5, 'jun'=>6, 'jul'=>7, 'aug'=>8, 'sep'=>9, 'oct'=>10, 'nov'=>11, 'dec'=>12); $month = $monthof[$month]; list($hour,$minute,$second) = split(':',$time); if ($gmt =="GMT") $gmt = 0; $gmt = $gmt /100; $hour = $hour - $gmt; // print $hour."|".$minute."|".$second; return mktime($hour,$minute,$second,$month,$day,$year); } |
代码: |
function Date2stamp($dateStr){ return strtotime($dateStr); } |