Home > Mobile >  Bringing datetime to a human readable level
Bringing datetime to a human readable level

Time:11-06

Membership dates are recorded in the database as follows.

But how can I make this datetime in a way that people can read comfortably (human-readable)?

Sample date:

2021-11-05T16:09:11.272738Z

Also, is it possible to get data like UTC within this date data? Like UTC 3.. I'm also using Carbon, is it possible to convert it with Carbon?

CodePudding user response:

you can use pure php as well.

Try this:

$OldDate = "2021-11-05T16:09:11.272738Z";
$newDate = date("d-m-Y", strtotime($OldDate));

result = 05-11-2021

  • Related