[PHP-DEV] Bug #10694 Updated: mktime leap year bug

2001-08-31 Thread derick

ID: 10694
Updated by: derick
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: Date/time related
Operating System: Redhat 6.2
PHP Version: 4.0.4
Assigned To: derick
New Comment:

Ok, I was just trying to explain the same thing after some
investigating...

Derick

Previous Comments:


[2001-08-31 14:05:10] [EMAIL PROTECTED]

The problem is how you look at it:
mktime first calculates year + month...
the last step is to add the seconds.

I wanted this the other way round. Would be a nice feature to select the priority of 
the different input values. When you use unix timestamps for calculations its very 
difficult to add 1 year (or something similar) to that date...



[2001-08-31 12:06:36] [EMAIL PROTECTED]

Status after almost three months???



[2001-05-07 04:23:18] [EMAIL PROTECTED]

Assigning to myself



[2001-05-07 01:50:21] [EMAIL PROTECTED]

first of all:
I use php 4.0.1pl2 and don't have the possibility to upgrade. Please verify with 
latest version. 

I tried to add 12 months to a given timestamp and figured out that mktime() doesn't 
include a 29th February into its calculations. Effect is, that following code doesn't 
jump forward 1 year during each loop. Every leap year 1 day gets lost!

$a = mktime(0,0,0,1,1,1970);
for ($i=0; $i<20; $i++) {
$a = mktime(0,0,3600 +$a,1+12,1,1970);
$b = date("d-m-Y", $a);
print "Date: $b";
}






Edit this bug report at http://bugs.php.net/?id=10694&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #10694 Updated: mktime leap year bug

2001-08-31 Thread schnitten

ID: 10694
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Status: Assigned
Status: Closed
Bug Type: Date/time related
Operating System: Redhat 6.2
PHP Version: 4.0.4
Old Assigned To: derick
Assigned To: 


Previous Comments:


[2001-08-31 12:06:36] [EMAIL PROTECTED]

Status after almost three months???



[2001-05-07 04:23:18] [EMAIL PROTECTED]

Assigning to myself



[2001-05-07 01:50:21] [EMAIL PROTECTED]

first of all:
I use php 4.0.1pl2 and don't have the possibility to upgrade. Please verify with 
latest version. 

I tried to add 12 months to a given timestamp and figured out that mktime() doesn't 
include a 29th February into its calculations. Effect is, that following code doesn't 
jump forward 1 year during each loop. Every leap year 1 day gets lost!

$a = mktime(0,0,0,1,1,1970);
for ($i=0; $i<20; $i++) {
$a = mktime(0,0,3600 +$a,1+12,1,1970);
$b = date("d-m-Y", $a);
print "Date: $b";
}






Edit this bug report at http://bugs.php.net/?id=10694&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #10694 Updated: mktime leap year bug

2001-08-31 Thread schnitten

ID: 10694
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Assigned
Bug Type: Date/time related
Operating System: Redhat 6.2
PHP Version: 4.0.4
Old Assigned To: derick
Assigned To: 
New Comment:

The problem is how you look at it:
mktime first calculates year + month...
the last step is to add the seconds.

I wanted this the other way round. Would be a nice feature to select the priority of 
the different input values. When you use unix timestamps for calculations its very 
difficult to add 1 year (or something similar) to that date...

Previous Comments:


[2001-08-31 12:06:36] [EMAIL PROTECTED]

Status after almost three months???



[2001-05-07 04:23:18] [EMAIL PROTECTED]

Assigning to myself



[2001-05-07 01:50:21] [EMAIL PROTECTED]

first of all:
I use php 4.0.1pl2 and don't have the possibility to upgrade. Please verify with 
latest version. 

I tried to add 12 months to a given timestamp and figured out that mktime() doesn't 
include a 29th February into its calculations. Effect is, that following code doesn't 
jump forward 1 year during each loop. Every leap year 1 day gets lost!

$a = mktime(0,0,0,1,1,1970);
for ($i=0; $i<20; $i++) {
$a = mktime(0,0,3600 +$a,1+12,1,1970);
$b = date("d-m-Y", $a);
print "Date: $b";
}






Edit this bug report at http://bugs.php.net/?id=10694&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #10694 Updated: mktime leap year bug

2001-08-31 Thread sander

ID: 10694
Updated by: sander
Reported By: [EMAIL PROTECTED]
Status: Assigned
Bug Type: Date/time related
Operating System: Redhat 6.2
PHP Version: 4.0.4
Assigned To: derick
New Comment:

Status after almost three months???

Previous Comments:


[2001-05-07 04:23:18] [EMAIL PROTECTED]

Assigning to myself



[2001-05-07 01:50:21] [EMAIL PROTECTED]

first of all:
I use php 4.0.1pl2 and don't have the possibility to upgrade. Please verify with 
latest version. 

I tried to add 12 months to a given timestamp and figured out that mktime() doesn't 
include a 29th February into its calculations. Effect is, that following code doesn't 
jump forward 1 year during each loop. Every leap year 1 day gets lost!

$a = mktime(0,0,0,1,1,1970);
for ($i=0; $i<20; $i++) {
$a = mktime(0,0,3600 +$a,1+12,1,1970);
$b = date("d-m-Y", $a);
print "Date: $b";
}






Edit this bug report at http://bugs.php.net/?id=10694&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #10694 Updated: mktime leap year bug

2001-05-07 Thread derick

ID: 10694
Updated by: derick
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Assigned
Bug Type: Date/time related
Operating system: 
PHP Version: 4.0.4
Assigned To: derick
Comments:

Assigning to myself

Previous Comments:
---

[2001-05-07 01:50:21] [EMAIL PROTECTED]
first of all:
I use php 4.0.1pl2 and don't have the possibility to upgrade. Please verify with 
latest version. 

I tried to add 12 months to a given timestamp and figured out that mktime() doesn't 
include a 29th February into its calculations. Effect is, that following code doesn't 
jump forward 1 year during each loop. Every leap year 1 day gets lost!

$a = mktime(0,0,0,1,1,1970);
for ($i=0; $i<20; $i++) {
$a = mktime(0,0,3600 +$a,1+12,1,1970);
$b = date("d-m-Y", $a);
print "Date: $b";
}


---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10694&edit=2


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]