From 94728f7301c8444f76a8e85c225d180bc460515d Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Fri, 26 Mar 2004 19:29:31 +0000 Subject: [PATCH] The 2am offset was a bad choice as this hour doesn't necessarily exist on a DST switch. So use 4am instead. Fixes bug #27719 --- ext/standard/datetime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 8d02fc5318..43017881b0 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -194,12 +194,12 @@ void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm) val = (*arguments[0])->value.lval; /* We don't use 1 here to work around problems in some mktime implementations - when it comes to daylight savings time. Setting it to 2 and working back from + when it comes to daylight savings time. Setting it to 4 and working back from there with the chgsecs offset makes us immune to these problems. See http://bugs.php.net/27533 for more info. */ - if (val < 2) { - chgsecs += (2-val) * 60*60; val = 2; + if (val < 4) { + chgsecs += (4-val) * 60*60; val = 4; } ta->tm_hour = val; /* fall-through */ -- 2.40.0