Answer the question
In order to leave comments, you need to log in
How to get the date in the form (yyyy-md) from the textual representation of the date (October 22, 2012)?
that is, from the date (October 22, 2012) - get 2012-10-22 Tell me
the functions or libraries that will help solve this problem in php.
In principle, you can implement it yourself. But still, are there any ready-made solutions?
Answer the question
In order to leave comments, you need to log in
As well as the regular datetime class
php.net/manual/en/class.datetime.php
strtotime is good, but deprecated and not universal.
$date = Datetime::createFromFormat(.......); // offsite syntax
echo $date->format('Ymd');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question