Get formatted string from formatted date using PHP

Is it possible to get formatted date string format in PHP?

For example,

Input: 2014-02-01
Output: Y-m-d

Input: February 1, 2014
Output: F j, Y

I understand that there will be problems with relative dates, such as tomorrowor 'next monday'. Thus, the input will be a complete date string in the format that is accepted strtotime.

+4
source share
1 answer

Like fooobar.com/questions/639816 / ... , there is no clear way to do this. You will need to create regular expressions for all formats that you want to support.

, , , , :

, 2 2009 , 09/03/02, 2009-03-02, 02/03/09, 03/02/09 09/02/03.

0

Source: https://habr.com/ru/post/1524863/


All Articles