|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-03 08:11 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 10 11:00:02 2025 UTC |
Description: ------------ Linux localhost 2.6.22-hardened-r8 #2 SMP Tue Dec 4 21:57:04 CST 2007 x86_64 Dual-Core AMD Opteron(tm) Processor 1210 AuthenticAMD GNU/Linux Im having problems with the date functions, seems the time_t used by php is 32bit, but the time_t of the system is 64bit. PHP uses 64bit integers so php is compiled for 64bit. To check the system time_t: #include <cstdio> #include <ctime> int main () { printf ("Size of time_t %d.\n", sizeof(time_t)); return 0; } g++ t.cpp -o t OUTPUT: Size of time_t 8. g++ -m32 t.cpp -o t OUTPUT: Size of time_t 4. Reproduce code: --------------- <?php echo "size: ",PHP_INT_SIZE,"\n"; echo "max: ",PHP_INT_MAX,"\n"; echo "mktime1: ",mktime(21,14,7,1,18,2038),"\n"; echo "mktime1: ",mktime(21,14,8,1,18,2038),"\n"; ?> Expected result: ---------------- size: 8 max: 9223372036854775807 mktime1: 2147483647 mktime2: 2147483648 Actual result: -------------- size: 8 max: 9223372036854775807 mktime1: 2147483647 mktime2: