Answer the question
In order to leave comments, you need to log in
How to manipulate date in php?
I can’t convert the date of the format 2016-02-29T21:53:00
to this format: год, месяц, день, часы, минуты
, i.e. 2016,02,29,21,53
without -,: and the letter T
I tried as in this article but nothing happened phpclub.ru/detail/article/date_stuff
Answer the question
In order to leave comments, you need to log in
You initially have a string in a non-normal format, so you must first convert it to the DateTime format,
and then further convert it:
$date = DateTime::createFromFormat('Y-m-d\TG:i:s', '2016-02-29T21:53:00');
echo $date->format('Y,m,d,G,i,s');
But if you directly convert what is already there - preg_replace will help.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question