使用PHP更改日期类型

使用PHP更改日期类型,php,excel,Php,Excel,这是我的密码: $date_depo = date('d-m-Y', strtotime($date_depot)); 因此,在我的excel表格中,我有=>11月2日16:00:00 此代码将其更改为=>02-11-2016 但是如果我有10 mai 13 00:00:00它会将其更改为01-01-1970 这意味着该值为0或类似值,我如何将其更改为=>10-05-2013 编辑: setlocale (LC_TIME, 'fr_FR.utf8','fra'); $date_depo =

这是我的密码:

$date_depo = date('d-m-Y', strtotime($date_depot));
因此,在我的excel表格中,我有=>11月2日16:00:00
此代码将其更改为=>02-11-2016

但是如果我有10 mai 13 00:00:00它会将其更改为01-01-1970 这意味着该值为0或类似值,我如何将其更改为=>10-05-2013

编辑:

setlocale (LC_TIME, 'fr_FR.utf8','fra'); 
$date_depo = strftime('%Y-%m-%d', $date_depot);   
不起作用

$trans = array('janv' => 'January ','févr' => 'February','mars' => 'March ','avr' => 'April','mai' => 'May','juin' => 'June','juil' => 'July','août' => 'August','sept' => 'September','oct' => 'October','nov' => 'November','déc' => 'December');
                $resulat= strtr($date_depot,$trans);
                $date_depot_t = date('d-m-Y', strtotime($resulat));    
每个月都要更换,但它能用


每个月都要更换,但它能用

mai
应该是
may
来正确解析php@u_mulder确实如此,但他们可能无法完全控制这一点。因此,他们需要其他东西来识别语言集。比如说像set LOCE(法语)。我明白了,有没有办法改变这一点,或者我必须写一个代码,把所有的月份都改成英语?@elianero你可以试试set LOCE-----最后一个恰好包含我给出的答案的地方;我甚至都不知道,萝莉是的,非常感谢!我刚刚接触PHP
mai
应该是
may
才能被正确解析php@u_mulder确实如此,但他们可能无法完全控制这一点。因此,他们需要其他东西来识别语言集。比如说像set LOCE(法语)。我明白了,有没有办法改变这一点,或者我必须写一个代码,把所有的月份都改成英语?@elianero你可以试试set LOCE-----最后一个恰好包含我给出的答案的地方;我甚至都不知道,萝莉是的,非常感谢!我刚刚接触PHP