summaryrefslogtreecommitdiff
path: root/ext/standard/datetime.c
diff options
context:
space:
mode:
authorChuck Hagenbuch <chagenbu@php.net>2000-11-11 17:28:20 +0000
committerChuck Hagenbuch <chagenbu@php.net>2000-11-11 17:28:20 +0000
commitb69dd89d34e3ac7f6362e38d6ea575a3394f3063 (patch)
treeb56dfdd35edcd6ea6593dd8d24dabaf7f45e41af /ext/standard/datetime.c
parent38569740da486809ee5b1a309c82cb364397932a (diff)
downloadphp-git-b69dd89d34e3ac7f6362e38d6ea575a3394f3063.tar.gz
RFC822 does specify two digit years, but practically every decent mail
client I could check is using 4-digit years these days.
Diffstat (limited to 'ext/standard/datetime.c')
-rw-r--r--ext/standard/datetime.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index ab1b751154..5029fd3c0d 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -248,7 +248,7 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
for (i = 0; i < (*format)->value.str.len; i++) {
switch ((*format)->value.str.val[i]) {
case 'r': /* rfc822 format */
- size += 29;
+ size += 31;
break;
case 'U': /* seconds since the epoch */
size += 10;
@@ -462,11 +462,11 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
break;
case 'r':
#if HAVE_TM_GMTOFF
- sprintf(tmp_buff, "%3s, %2d %3s %02d %02d:%02d:%02d %c%02d%02d",
+ sprintf(tmp_buff, "%3s, %2d %3s %04d %02d:%02d:%02d %c%02d%02d",
day_short_names[ta->tm_wday],
ta->tm_mday,
mon_short_names[ta->tm_mon],
- ((ta->tm_year)%100),
+ ta->tm_year + 1900,
ta->tm_hour,
ta->tm_min,
ta->tm_sec,
@@ -475,11 +475,11 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
abs( ta->tm_gmtoff % 3600)
);
#else
- sprintf(tmp_buff, "%3s, %2d %3s %02d %02d:%02d:%02d %c%02d%02d",
+ sprintf(tmp_buff, "%3s, %2d %3s %04d %02d:%02d:%02d %c%02d%02d",
day_short_names[ta->tm_wday],
ta->tm_mday,
mon_short_names[ta->tm_mon],
- ((ta->tm_year)%100),
+ ta->tm_year + 1900,
ta->tm_hour,
ta->tm_min,
ta->tm_sec,