最近将一个网站的mssql数据库导入到phpcms的mysql中,mssql数据库中时间格式为2004-3-1 16:58:00,导入到mysql格式为1265264139。 通过strtotime() 函数将任何英文文本的日期时间描述解析为 Unix 时间戳。 [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]
发表评论