G
G
gachkydxvbgd2018-05-08 12:30:10
Laravel
gachkydxvbgd, 2018-05-08 12:30:10

How to generate datatime in this format?

How to generate such 2018-01-07T15:54:21Z ?
"timezone_type": 2
"timezone": "Z"
Then add 3 minutes and compare

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tesla, 2018-05-08
@Tesla

https://carbon.nesbot.com/docs/

E
eg00, 2018-05-10
@eg00

$date = new DateTime();
$newdate = clone $date;
$newdate = $newdate->add(new DateInterval('PT3M'));
$interval = $date->diff($newdate);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question