close

[Solved] Php Convert date time like “2017-01-10T18:00:00.000Z” to standard time

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Php Convert date time like “2017-01-10T18:00:00.000Z” to standard time in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Php Convert date time like “2017-01-10T18:00:00.000Z” to standard time Error Occurs?

Today I get the following error Php Convert date time like “2017-01-10T18:00:00.000Z” to standard time in php.

How To Solve Php Convert date time like “2017-01-10T18:00:00.000Z” to standard time Error ?

  1. How To Solve Php Convert date time like “2017-01-10T18:00:00.000Z” to standard time Error ?

    To Solve Php Convert date time like “2017-01-10T18:00:00.000Z” to standard time Error you can use date('Y-m-d h:i:s', strtotime($yourDate));
    Hope it will help you 🙂

  2. To Solve Php Convert date time like “2017-01-10T18:00:00.000Z” to standard time Error

    To Solve Php Convert date time like “2017-01-10T18:00:00.000Z” to standard time Error you can use date('Y-m-d h:i:s', strtotime($yourDate));
    Hope it will help you 🙂

Solution 1

you can use date('Y-m-d h:i:s', strtotime($yourDate));
Hope it will help you 🙂

Solution 2

Ah OK…in php, that long timestamp ending with Z can be converted to a unix timestamp with strototime and then back to a date using the date function

echo date("Y-m-d H:i:s", strtotime("2017-01-10T18:00:00.000Z")) . "\n";

WARNING: the current time zone setting on your server may result in the time being adjusted

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment