Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #38777 : get a day in the future
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 28th August 20:51
php-bugs@lists.php.net (magnus at ronnerup dot
External User
 
Posts: 1
Default #38777 : get a day in the future


From: magnus at ronnerup dot se
Operating system: linux (unknown dist.)
PHP version: 4.4.4
PHP Bug Type: Date/time related
Bug description: get a day in the future

Description:
------------
It doesnt count to the right day. could be a summer/wintertime bug?

Reproduce code:
---------------
$order["journey_stay_first"] = 1161900000;

$adddays = $order["journey_stay_first"] + ( $_GET["x"] * 24 * 60 * 60);

$journey_first_stay_date = date('ymd', $order["journey_stay_first"]);
$journey_last_stay_date = date('ymd', $adddays);

Expected result:
----------------
$order["journey_stay_first"] = 1161900000;
x, start, end:
0, 06 10 27 12:00:00, 06 10 27 12:00:01
1, 06 10 27 12:00:00, 06 10 28 12:00:01
2, 06 10 27 12:00:00, 06 10 29 12:00:01
3, 06 10 27 12:00:00, 06 10 30 11:00:01
4, 06 10 27 12:00:00, 06 10 31 11:00:01

Actual result:
--------------
$order["journey_stay_first"] = 1161900000;
x, start, end:
0, 06 10 27 12:00:00, 06 10 27 12:00:01
1, 06 10 27 12:00:00, 06 10 28 12:00:01
2, 06 10 27 12:00:00, 06 10 29 12:00:01
3, 06 10 27 12:00:00, 06 10 29 11:00:01
4, 06 10 27 12:00:00, 06 10 30 11:00:01

--
Edit bug report at http://bugs.php.net/?id=38777&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38777&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38777&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38777&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38777&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38777&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38777&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38777&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38777&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38777&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38777&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38777&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38777&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38777&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38777&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38777&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38777&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38777&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38777&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38777&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38777&r=mysqlcfg
  Reply With Quote


  sponsored links


2 28th August 20:51
johannes
External User
 
Posts: 1
Default #38777 : get a day in the future


ID: 38777
Updated by: johannes@php.net
Reported By: magnus at ronnerup dot se
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: linux (unknown dist.)
PHP Version: 4.4.4
New Comment:

We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
http://webexhibits.org/daylightsaving/b.html
Instead of using mktime/date consider using gmmktime and gmdate which
do
not suffer from DST.

You are not adding days but seconds as an offset.


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

[2006-09-11 07:15:16] magnus at ronnerup dot se

Description:
------------
It doesnt count to the right day. could be a summer/wintertime bug?

Reproduce code:
---------------
$order["journey_stay_first"] = 1161900000;

$adddays = $order["journey_stay_first"] + ( $_GET["x"] * 24 * 60 * 60);

$journey_first_stay_date = date('ymd', $order["journey_stay_first"]);
$journey_last_stay_date = date('ymd', $adddays);

Expected result:
----------------
$order["journey_stay_first"] = 1161900000;
x, start, end:
0, 06 10 27 12:00:00, 06 10 27 12:00:01
1, 06 10 27 12:00:00, 06 10 28 12:00:01
2, 06 10 27 12:00:00, 06 10 29 12:00:01
3, 06 10 27 12:00:00, 06 10 30 11:00:01
4, 06 10 27 12:00:00, 06 10 31 11:00:01

Actual result:
--------------
$order["journey_stay_first"] = 1161900000;
x, start, end:
0, 06 10 27 12:00:00, 06 10 27 12:00:01
1, 06 10 27 12:00:00, 06 10 28 12:00:01
2, 06 10 27 12:00:00, 06 10 29 12:00:01
3, 06 10 27 12:00:00, 06 10 29 11:00:01
4, 06 10 27 12:00:00, 06 10 30 11:00:01


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


--
Edit this bug report at http://bugs.php.net/?id=38777&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666