Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何比较两个 DateInterval 对象?就像是:
$d1 = new DateInterval("P1M"); $d2 = new DateInterval("P2M"); if($d2 > $d1) { do something ... }
我可以将 DateIntervals 转换为秒,但有什么更好的方法吗?
感谢您的帮助!
最好的祝福,
弗雷迪
到目前为止,转换为秒是唯一的方法。