H
H
hard_o2021-07-27 15:15:03
PHP
hard_o, 2021-07-27 15:15:03

How to parse a date in PHP?

There is a date

2020-01-13 16:35:31.000000+0000


What is the format of this date?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hard_o, 2021-07-27
@hard_o

<?php
    $dt = '2020-01-13 16:35:31.000000 + 0000';
    $dt = str_ireplace(['- ', '+ '], ['-', '+'], $dt);
    $matchStartTime = DateTime::createFromFormat('Y-m-d H:i:s.u O', $dt);

S
Sergey delphinpro, 2021-07-27
@delphinpro

https://ru.wikipedia.org/wiki/ISO_8601

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question