#34158 [NoF->Opn]: Wrong t.tm_isdst flag value.
| From: | aesthete at telecenter dot ru | Date: | Sun, 05 Feb 2006 10:57:02 +0000 |
| Subject: | #34158 [NoF->Opn]: Wrong t.tm_isdst flag value. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-92924@lists.php.net to get a copy of this message | ||
ID: 34158
User updated by: aesthete at telecenter dot ru
Reported By: aesthete at telecenter dot ru
-Status: No Feedback
+Status: Open
Bug Type: InterBase related
Operating System: Linux 2.6.12 (Fedora Core 3)
PHP Version: 4.4.0
New Comment:
In php-5.1.2 this bug too ...
Previous Comments:
------------------------------------------------------------------------
[2006-01-17 15:05:21] c dot coppari at sintekno dot it
I think the problem is in mktime() function, at line:
timestamp = mktime(&t);
This is because the variable t for SQL_TYPE_TIME doesn't get the proper
values for month, year and day.
The mktime() function tries to normalize the date, however with libc6
this result in an incorrect time.
I used this patch:
case SQL_TYPE_TIME:
isc_decode_sql_time((ISC_TIME *) data, &t);
format = IBG(timeformat);
t.tm_mday = 16;
t.tm_mon = 0;
t.tm_year = 106;
break;
Forcing the day, month and year with a correct value solved the problem
for me.
I don't know if this is the correct behaviour of mktime().
------------------------------------------------------------------------
[2005-11-28 12:17:17] tony2001@php.net
[20 Sep 11:13pm CEST] sniper@php.net
Can you please give a try for the PDO driver?
------------------------------------------------------------------------
[2005-08-16 21:37:10] aesthete at telecenter dot ru
Description:
------------
My previos message was about Wrong Time conersion from db:
http://bugs.php.net/bug.php?id=34037&edit=1
I solved my problem when comment t.tm_isdst = -1; in interbase.c
I don't know is there bug of php or interbase but i have some ideas
abot it.
In interbase.c we have some code:
/*
XXX - Might have to remove this later - seems that
isc_decode_date()
always sets tm_isdst to 0,
sometimes incorrectly (InterBase 6 bug?)
*/
t.tm_isdst = -1;
As you say in your comment:
"isc_decode_date() always sets tm_isdst to 0" ... thats true.
But in gds.cpp (firebird 1.5.2 source) nothing said about changeing
tm_isdst (in all gds.cpp)
to any value Except for 0 in memset(times, 0, sizeof(*times))
instructions.
It always return tm_isdst = 0 in all api functions where "struct tm
*times" used as argument!
I dont know why you do t.tm_isdst = -1;
Therefore strftime(string_data, sizeof(string_data), format, &t) cannot
return right formated time string.
May be it php bug ?)
P.S.: Sorry my english.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34158&edit=1