Bug #66257 [NEW]: strtotime doesn't use current timezone on '4 thursdays'
From: mfaust at usiwireless dot com
Operating system: Linux
PHP version: 5.4.22
Package: Date/time related
Bug Type: Bug
Bug description:strtotime doesn't use current timezone on '4 thursdays'
Description:
------------
---
From manual page: http://www.php.net/function.strtotime
---
date_default_timezone_set('UTC');
$timestamp = mktime(0,0,0,11,1,2014);
strtotime('4 thursdays', $timestamp) does not return the same timestamp
as strtotime('first thursday + 3 weeks', $timestamp)
The first call returns a timestamp indicating a time of 6am (we are in
CST) and the second returns a timestamp indicating 12am.
Test script:
---------------
//The server timezone is America/Chicago
$timestamp = mktime(0,0,0,11,1,2014);
echo strtotime('4 thursdays', $timestamp) . "\n";
strtotime('first thursday + 3 weeks', $timestamp) . "\n";
Expected result:
----------------
Both should return the same timestamp indicating 12:00 am.
--
Edit bug report at https://bugs.php.net/bug.php?id=66257&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66257&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66257&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66257&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66257&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66257&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66257&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66257&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66257&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66257&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66257&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66257&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66257&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66257&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66257&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66257&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66257&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66257&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66257&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66257&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66257&r=mysqlcfg
Thread (12 messages)
- mfaust at usiwireless dot com
- derick@php.netBug #66257 [Opn->Fbk]: strtotime doesn't use current timezone on '4 thursdays'
- php-bugs at lists dot php dot netBug #66257 [Fbk->NoF]: strtotime doesn't use current timezone on '4 thursdays'
- mfaust at usiwireless dot comBug #66257 [Com]: strtotime doesn't use current timezone on '4 thursdays'
- mfaust at usiwireless dot comBug #66257 [Com]: strtotime doesn't use current timezone on '4 thursdays'
- mfaust at usiwireless dot comBug #66257 [Com]: strtotime doesn't use current timezone on '4 thursdays'
- requinix@php.netBug #66257 [NoF->Opn]: strtotime doesn't use current timezone on '4 thursdays'
- cmb@php.netBug #66257 [Opn->Ver]: strtotime doesn't use current timezone on '4 thursdays'
- derick@php.netBug #66257 [Ver->Asn]: strtotime doesn't use current timezone on '4 thursdays'
- d at ja dot vuBug #66257 [Com]: strtotime doesn't use current timezone on '4 thursdays'
- cmb@php.netBug #66257 [Asn]: strtotime doesn't use current timezone on '4 thursdays'
- derick@php.netBug #66257 [Asn->Dup]: strtotime doesn't use current timezone on '4 thursdays'