Such is, in my opinion, an interesting problem. There is a text, for example:

good day! looking for a guide with spanish on 24-25.06, not a cruise. 24.06 - afternoon, Hermitage, payment 4000. 25.06 1 day with Peterhof, payment 6000. guide found, thank you all for the response!

We are looking for an individual guide on the 13th, 14th, 15th of July, the language of Portuguese, 20 euros per hour. good day ! need 21.06 in the afternoon, the Portuguese guide for 5 hours of sightseeing

need a Polish guide on June 10 from 17:00 to 19:00 on the ship

How do all dates that appear in it convert to date('Ym-d') ?

  • you make all possible spellings of dates (although it is unlikely that you will succeed) and then take on regular expressions - teran
  • @teran basically, I brought all the possible options in the question) - iKey
  • I think it looks like some sort of arbitrary user messages, so that there will be a lot of possible options, for example, 30.01-1.02 , are you going to take the current year? What about the message in December about 31.12-03.01 / 31.12-03.01 ? or the 13-е through a hyphen? Or instead of августа will be written агуста? Or a person is not sure, and write ищем на 10е или 11 января . - teran pm

1 answer 1

Dates of type 24-25.06 24.06, in principle, you can parse through regular expressions (regular expression google). The 13th, 14th, 15th of July will be problematic, but, in principle, it is also possible to divide regular expressions by day and month, and turn a month from letters into a number through a switch case. I don’t know the automatic method of processing such dates, but perhaps there is a library on php that will help you.