[PHP-DEV] [PATCH] Fix date() bug

2008-09-27 Thread Ilia Cheishvili
Hi all, This patch addresses the issue with the date() function. When passing in a 'u', the date() function simply outputs six zeros. To fix this, I added a gettimeofday() call that figures out what to display for microseconds. I am including the headers and using the function with

Re: [PHP-DEV] [PATCH] Fix date() bug

2008-09-27 Thread Alexey Zakhlestin
On Sat, Sep 27, 2008 at 11:04 AM, Ilia Cheishvili [EMAIL PROTECTED] wrote: Hi all, This patch addresses the issue with the date() function. When passing in a 'u', the date() function simply outputs six zeros. To fix this, I added a gettimeofday() call that figures out what to display for

Re: [PHP-DEV] [PATCH] Fix date() bug

2008-09-27 Thread Ilia Cheishvili
It definitely would be, and that's actually the way I would have preferred to do it. I didn't want to impact too much code, if that makes sense in this case, but I'm glad that someone agrees :) I have attached a patch to do exactly this. Ilia On Sat, Sep 27, 2008 at 1:40 AM, Alexey Zakhlestin

Re: [PHP-DEV] [PATCH] Fix date() bug

2008-09-27 Thread Alexey Zakhlestin
On Sat, Sep 27, 2008 at 12:04 PM, Ilia Cheishvili [EMAIL PROTECTED] wrote: It definitely would be, and that's actually the way I would have preferred to do it. I didn't want to impact too much code, if that makes sense in this case, but I'm glad that someone agrees :) I have attached a patch

Re: [PHP-DEV] [PATCH] Fix date() bug

2008-09-27 Thread Ilia Cheishvili
Ah, I see. I like that even better :) And I attached yet another patch that incorporates your idea. Ilia On Sat, Sep 27, 2008 at 2:20 AM, Alexey Zakhlestin [EMAIL PROTECTED]wrote: On Sat, Sep 27, 2008 at 12:04 PM, Ilia Cheishvili [EMAIL PROTECTED] wrote: It definitely would be, and that's

Re: [PHP-DEV] [PATCH] Fix date() bug

2008-09-27 Thread Alexey Zakhlestin
On Sat, Sep 27, 2008 at 12:26 PM, Ilia Cheishvili [EMAIL PROTECTED] wrote: Ah, I see. I like that even better :) And I attached yet another patch that incorporates your idea. thanks. I did some more code-digging, and it looks, like proper point for fixing is not here, anyway. It should be in

Re: [PHP-DEV] [PATCH] Fix date() bug

2008-09-27 Thread Alexey Zakhlestin
On Sat, Sep 27, 2008 at 1:28 PM, Hannes Magnusson [EMAIL PROTECTED] wrote: On Sat, Sep 27, 2008 at 09:04, Ilia Cheishvili [EMAIL PROTECTED] wrote: Hi all, This patch addresses the issue with the date() function. When passing in a 'u', the date() function simply outputs six zeros. To fix

Re: [PHP-DEV] [PATCH] Fix date() bug

2008-09-27 Thread Ilia Cheishvili
I did some digging around in the code and came up with the solution that you suggested. I put the fix in unixtime2tm.c, letting php_date.c remain the nice abstraction layer between the system-dependent code of getting the time and actually formatting it for display. The patch is attached.