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.
我想以与 eloquent 推送到数据库相同的格式获取当前时间的时间戳。
喜欢:yyyy-mm-dd xx.xx.xx
我该怎么做?
Laravel 使用Carbon作为 DateTime 类,所以你可以这样做:
$dt = Model::find(1)->created_at; echo $dt->toDateTimeString();
以您需要的方式获得它。