0
我有startdate
和enddate
格式Y-m-d
。如何获得Laravel的月份持续时间
'startdate'=>date('Y-m-d', strtotime(Input::get('startdate'))),
'enddate'=>date('Y-m-d', strtotime(Input::get('enddate')))
我怎样才能得到这两天的时间,像Laravel 2 months
或1 month
或2 weeks
?
如果你不需要 '之前'/ '后' 的落后字: '回声的preg_replace( '/(.*)(前|后)/', '$ 1',$ startDate- > diffForHumans($结束日期));' – 2014-11-20 18:34:18