2015/06/03

How to match GMT date using regular expression in PHP ?

// GMT date format 3 Jun 2015 06:59:23
preg_match("/(?<day>\d{1,2}) (?<month>[a-zA-Z]{3}) (?<year>\d{4}) (?<hours>\d{1,2}):(?<minutes>\d{2}):(?<seconds>\d{2})/", $date, $match);
view raw gistfile1.php hosted with ❤ by GitHub

No comments:

Post a Comment