How to compare two Carbon Timestamps?

后端 未结 4 655
你的背包
你的背包 2020-11-29 17:52

I have two timestamps, edited_at which I created and created_at (Laravel\'s)... In database, both have type timestamp and default value 0000-00-00 00:00:00... But

4条回答
  •  时光说笑
    2020-11-29 18:30

    This is how I am comparing 2 dates, now() and a date from the table

    @if (\Carbon\Carbon::now()->lte($item->client->event_date_from))
        .....
        .....
    @endif
    

    Should work just right. I have used the comparison functions provided by Carbon.

提交回复
热议问题