开发者

PHP date and Zend_Date conversion?

I've got this date :

$date = 'Mon Feb 07 00:00:00 CST 2011';

But I want $date to be formatted as 02-07-2011 only, using Zend framework or core 开发者_如何学Pythonphp also.


<?php
$date = new DateTime('Mon Feb 07 00:00:00 CST 2011');

echo $date->format('m-d-Y');


$date='Mon Feb 07 00:00:00 CST 2011';
echo date('m-d-Y',strtotime($date));

Working example at http://codepad.org/gYfgYqED

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜