一个帮助控制时间流逝的助手
是一个出色的库,可以在PHP项目中使用时间。 Spatie\TestTime\TestTime类包含一些函数,这些函数在Spatie\TestTime\TestTime操作被Carbon视为当前时间的时间。
// the flow of time is frozen
TestTime :: freeze ();
// we're now one year in the future
TestTime :: addYear ();
// will report the real current year + 1
$ year = ( new Carbon ())-