kakaxi

function GmtToUnix($GmtDate)

{

$DateArr = explode(\' \',$GmtDate); // 分割GMT日期为 日期 | 时间

/* 在日期中取得年,月,日 */

$pDate = preg_split(\'[/.-]\',$DateArr[0]);

$Year = $pDate[0];

$Month = $pDate[1];

$Day = $pDate[2];

/* 在时间中取得时,分,秒 */

$pTime = preg_split(\'[:.-]\',$DateArr[1]);

$Hour = $pTime[0];

$Minute = $pTime[1];

$Second = $pTime[2];

if($Year == \'\' || !is_numeric($Year))

$Year = 0;

if($Month == \'\' || !is_numeric($Month))

$Month = 0;

if($Day == \'\' || !is_numeric($Day))

$Day = 0;

if($Hour == \'\' || !is_numeric($Hour))

$Hour = 0;

if($Minute == \'\' || !is_numeric($Minute))

$Minute = 0;

if($Second == \'\' || !is_numeric($Second))

$Second = 0;

return mktime($Hour,$Minute,$Second,$Month,$Day,$Year);

}


分类:

技术点:

相关文章: