Parsing a string for dates in PHP
Posted
by nickf
on Stack Overflow
See other posts from Stack Overflow
or by nickf
Published on 2010-06-16T13:21:40Z
Indexed on
2010/06/16
13:32 UTC
Read the original article
Hit count: 127
Given an arbitrary string, for example ("I'm going to play croquet next Friday"
or "Gadzooks, is it 17th June already?"
), how would you go about extracting the dates from there?
If this is looking like a good candidate for the too-hard basket, perhaps you could suggest an alternative. I want to be able to parse Twitter messages for dates. The tweets I'd be looking at would be ones which users are directing at this service, so they could be coached into using an easier format, however I'd like it to be as transparent as possible. Is there a good middle ground you could think of?
© Stack Overflow or respective owner