Bug #66257 [NoF->Opn]: strtotime doesn't use current timezone on '4 thursdays'

From: Date: Tue, 30 Dec 2014 18:54:07 +0000
Subject: Bug #66257 [NoF->Opn]: strtotime doesn't use current timezone on '4 thursdays'
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189548@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66257&edit=1

 ID:                 66257
 Updated by:         requinix@php.net
 Reported by:        mfaust at usiwireless dot com
 Summary:            strtotime doesn't use current timezone on '4
                     thursdays'
-Status:             No Feedback
+Status:             Open
 Type:               Bug
 Package:            Date/time related
 Operating System:   Linux
 PHP Version:        5.4.22
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2014-12-30 16:52:29] mfaust at usiwireless dot com

sorry, I meant "re-opened"

------------------------------------------------------------------------
[2014-12-30 16:52:07] mfaust at usiwireless dot com

I am unable to change the status back to "unopened" due to "ERROR:
You aren't allowed to change a bug to that state."

------------------------------------------------------------------------
[2014-12-30 16:49:41] mfaust at usiwireless dot com

This still occurs on PHP 5.6.4

<?php
echo date_default_timezone_get() . "\n;
date_default_timezone_set('UTC');
$timestamp = mktime(0,0,0,11,1,2014);
echo strtotime('4 thursdays', $timestamp) . "\n";
echo strtotime('first thursday + 3 weeks', $timestamp) . "\n";
?>

Output:
America/Chicago
1417068000
1417046400

------------------------------------------------------------------------
[2014-12-30 10:42:10] php-bugs at lists dot php dot net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.

------------------------------------------------------------------------
[2013-12-10 18:30:50] derick@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

The following works just fine here:
<?php
date_default_timezone_set("America/Chicago");
$timestamp = mktime(0,0,0,11,1,2014);
$a = strtotime('4 thursdays', $timestamp);
$b = strtotime('first thursday + 3 weeks', $timestamp);

echo date(DateTime::ISO8601, $a), "\n";
echo date(DateTime::ISO8601, $b), "\n";
?>

outputs:
2014-11-27T00:00:00-0600
2014-11-27T00:00:00-0600


This is with PHP 5.4.24

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=66257


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


Thread (12 messages)

« previous php.bugs (#189548) next »