最近將一個(gè)網(wǎng)站的mssql數(shù)據(jù)庫導(dǎo)入到phpcms的mysql中,mssql數(shù)據(jù)庫中時(shí)間格式為2004-3-1 16:58:00,導(dǎo)入到mysql格式為1265264139。 通過strtotime() 函數(shù)將任何英文文本的日期時(shí)間描述解析為 Unix 時(shí)間戳。 [php] <?php echo(strtotime("now")); echo(strtotime("3 October 2005")); echo(strtotime("+5 hours")); echo(strtotime("+1 week")); echo(strtotime("+1 week 3 days 7 hours 5 seconds")); echo(strtotime("next Monday")); echo(strtotime("last Sunday")); ?> [/php]
發(fā)表評(píng)論