0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Laravel Adminで表示される日時のフォーマットがおかしい時の対処方法

Posted at

現象

本来は特に何も指定しなくても 2023-06-01 12:00:00 のように表示されるはずが、 2023-06-01T12:00:00.000000Z のように表示されてしまうことがあった。

これまでLaravel 6.x(PHP7.3)では1度も観測していなかったが、Laravel 10(PHP8.2) にアップグレード後、画面によって発生することがあった。

対処方法

before:

$grid->column('created_at', __('Created at'));

after:

$grid->column('created_at', __('Created at'))->display(function ($time) {
    return date("Y/m/d H:i:s", strtotime($time));
});

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?