English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am looking for a way to conver time as defined by http://www.rfc-editor.org/rfc/rfc822.txt section 5 (RFC822) (ex. Thu, 27 Jul 2006 13:21:11 -0700) to a unix time stop for use in PHP. Thanks for the help, i have looked around on google for help but can't find anything. Maybe there is a more common name for this type of time that i need to serach for...

2006-07-27 09:41:45 · 2 answers · asked by Brady 3 in Computers & Internet Programming & Design

strtotime() works great, thanks for the help. They should include that function as a related function on the date() page, but this isn't the place to complain about that. I can't choose you as the best answer for a couple hours but thanks for the help.

2006-07-27 10:17:37 · update #1

2 answers

I think strtotime() should work. If not, you will need to parse it out using a regular expression.

The regular expression should look something like:
/([0-9]{2}) ([a-z]{3}) ([0-9]{4}) ([0-9]{2}):([0-9]{2}):([0-9]{2})/i

you can then parse it out using preg_match ($regexp, $str, $matches);

then you would have:
date - $matches[1]
month - $matches[2]
year - $matches[3]
etc.
that you can put into strtotime properly.

2006-07-27 09:53:12 · answer #1 · answered by John J 6 · 9 4

happy New 300 and sixty 5 days MM! There probable sick of an identical questions asked each and all of the time on R&S. i understand the keys on my board are wearing out from an identical solutions. we choose some new questions. God bless you.

2016-12-10 16:46:37 · answer #2 · answered by hirschfeld 4 · 0 0

fedest.com, questions and answers