ID:               15115
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         Date/time related
 Operating System: Win2000 Server
 PHP Version:      4.1.1
 New Comment:

Not a bug in PHP, 'Sa' is not supposed to work. It's clearly a bug in
the mailer.

Derick


Previous Comments:
------------------------------------------------------------------------

[2002-01-22 18:39:37] [EMAIL PROTECTED]

Today I looked into the sourcecode of the strtotime function and found
out that you only search for 3-character abbreviations. I think it's
impossible to search for 2-character abbreviations because they
wouldn't be unique...

I think this solution also works fine for me:

<?
  $dheader="Sa, 19 Jan 2002 12:28:51 -1100";
  echo strtotime(ltrim(substr($dheader,-strlen($dbheader)+4))); //
prints '1011482931'
?>

I just cut away the 2- or 3-character abbreviation and the comma, then
I cut away the remaining whitespace at the beginning of the string (if
one exists...but it's not necessary to cut it away) and then I do the
conversion. That should work fine for every 'Date:' header.

------------------------------------------------------------------------

[2002-01-19 12:24:05] [EMAIL PROTECTED]

What I do is parsing Mail-Headers, especially the 'Date:' header. One
mail I parsed had the following 'Date:' header:

Date: Sa, 19 Jan 2002 12:28:51 -1100

strtotime just returns -1 after parsing this string:

<?
  $dheader="Sa, 19 Jan 2002 12:28:51 -1100";
  echo strtotime($dheader); // prints '-1'
?>

when I replace 'Sa' with 'Sat', it returns the correct value:

<?
  $dheader="Sat, 19 Jan 2002 12:28:51 -1100";
  echo strtotime($dheader); // prints '1011482931'
?>

I am in Timezone GMT+1.
Now should I find a workaround to this problem by replacing 'Sa' with
'Sat' for myself (so this is a mailer-problem) or perhaps you should
consider this in your implementation (I don't know how often this
'Sa'/'Sat' problem occurs.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=15115&edit=1

Reply via email to