Php 如何将今天的日期与使用Laravel 5.4创建的日期时间戳进行比较
我想让用户每1年更新一次应用程序。例如,今天是2017年8月14日,如果日期是2018年8月14日,应用程序将告诉用户他需要续订应用程序Php 如何将今天的日期与使用Laravel 5.4创建的日期时间戳进行比较,php,laravel,laravel-5,laravel-5.4,Php,Laravel,Laravel 5,Laravel 5.4,我想让用户每1年更新一次应用程序。例如,今天是2017年8月14日,如果日期是2018年8月14日,应用程序将告诉用户他需要续订应用程序 @if ($application->created_at->todatestring() != 2018-08-14) <h1>You need to renew your application!</h1> @endif @if($application->created_at->todatestring()!=
@if ($application->created_at->todatestring() != 2018-08-14)
<h1>You need to renew your application!</h1>
@endif
@if($application->created_at->todatestring()!=2018-08-14)
你需要更新你的申请!
@恩迪夫
因此,默认情况下,并不总是需要更新应用程序。那么,明年我将如何获得来年的价值呢?如何增加年数或将年数加1
正在寻求帮助。
提前感谢。预计在创建的
是一个对象:
@if($application->created_at->addYear()->gt(\Carbon\Carbon::now()))
你需要更新你的申请!
@恩迪夫
请参阅详细信息。在
处创建的预期是一个对象:
@if($application->created_at->addYear()->gt(\Carbon\Carbon::now()))
你需要更新你的申请!
@恩迪夫
查看更多信息。谢谢!顺便问一下,如果我更改了机器中的时间设置,我的应用程序总是会崩溃,那么我该如何测试它是否工作呢!顺便问一下,如果我更改了机器中的时间设置,我的应用程序总是会崩溃,那么我该如何测试它是否工作呢?
@if ($application->created_at->addYear()->gt(\Carbon\Carbon::now()))
<h1>You need to renew your application!</h1>
@endif