B
B
Berkutman2020-05-02 18:17:26
PHP
Berkutman, 2020-05-02 18:17:26

How to convert text using php regular expressions?

How to get 02/05/2020 from the given text 2020-05-02T00:29:15.0+07:00 ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Morev, 2020-05-02
@Berkutman

Why do you need regular expressions here? This is the standard date format and there are built-in functions.

$date = new DateTime('2020-05-02T00:29:15.0+07:00');
echo $date->format('d/m/Y');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question