【发布时间】:2011-01-22 20:42:22
【问题描述】:
我需要一个 php4 中的函数来计算提供的日期格式的日期差异。 例如。
$date1 = "2011-08-24 10:03:00";
$date2 = "2012-09-24 10:04:31";
$format1 = "Y W" ; //This format should return the difference in Year and week.
$format2 = "M D"; // This format should return the difference in Months and days.
// The format can be any combination of Year,Month,Day,Week,Hour,Minute,Second.
function ConvertDate($data1,$date2,$format)
如果您需要更多详细信息,请告诉我。 提前致谢。
【问题讨论】:
-
好像我真的需要这么说,但你真的需要先升级你的PHP版本。 PHP4 已经有一段时间不被支持了...
-
是的,实际上我同意你的观点,在 php5 中有很好的功能,但我只需要在 php4 中执行此操作,因为我还必须支持 php4。