# report of date functions on windows

- Thread: https://externals.io/message/19619
- Original archive: https://news-web.php.net/php.internals/19619
- Started by Nuno Lopes on 2005-10-14T22:24:02+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #19619 — Nuno Lopes — 2005-10-14T22:24:02+00:00

URL: https://externals.io/message/19619#19619

Hi,

In the last hours I've been debugging and testing the new implementation of 
the date related functions on windows.
I've found some little problems:

1) timelib_tz_lookup_table defines the gmtoffset as an int, but in the 
fallback table there are some decimals numbers. So, either remove those 
entries or change the struct to hold a float. This also applies to the 
timelib_timezone_id_from_abbr() function, which receives a long, instead of 
a float.

2) in the guess_timezone() function, the offset maths are being truncated. 
the explicit cast to float doesn't help either, because it happens before 
reaching there.

3) the fallback table isn't complete (and had an error). I've added a couple 
more tzs.

4) I've fixed the problem I've reported earlier with timezones that don't 
have DST settings (or when the user disables DST in control panel).


A patch to fix 2, 3 and 4: http://mega.ist.utl.pt/~ncpl/php_win_date2.txt


Apart of these little issues, the new code is working perfectly!

Nuno

---

## #19621 — Derick Rethans — 2005-10-15T18:20:26+00:00

URL: https://externals.io/message/19619#19621 · In reply to: #19619

> Hi,
> 
> In the last hours I've been debugging and testing the new implementation of
> the date related functions on windows.
> I've found some little problems:
> 
> 1) timelib_tz_lookup_table defines the gmtoffset as an int, but in the
> fallback table there are some decimals numbers. So, either remove those
> entries or change the struct to hold a float. This also applies to the
> timelib_timezone_id_from_abbr() function, which receives a long, instead of a
> float.
> 
> 2) in the guess_timezone() function, the offset maths are being truncated. the
> explicit cast to float doesn't help either, because it happens before reaching
> there.
> 
> 3) the fallback table isn't complete (and had an error). I've added a couple
> more tzs.
> 
> 4) I've fixed the problem I've reported earlier with timezones that don't have
> DST settings (or when the user disables DST in control panel).
> 
> 
> A patch to fix 2, 3 and 4: http://mega.ist.utl.pt/~ncpl/php_win_date2.txt

I committed a slightly modified patch (you should not use any of the 
US/* mappings f.e.). Thanks.

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

---

## #19622 — Derick Rethans — 2005-10-15T18:22:23+00:00

URL: https://externals.io/message/19619#19622

> I hate to be annoying (OK, no I don't), but who's in charge of the
> grammar of the error messages? Judging solely from the lines in that
> patch (no part of the error message is actually changed in the patch),
> I can see a missing apostrophe, as well as comma/period/semicolon
> mix-ups. Just a heads up, of course....

If you're such a grammar wizz, can you provide an alternative text 
perhaps?

Derick
-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

---

## #19643 — Nuno Lopes — 2005-10-16T19:19:03+00:00

URL: https://externals.io/message/19619#19643 · In reply to: #19621

> > […]
> I committed a slightly modified patch (you should not use any of the
> US/* mappings f.e.). Thanks.
>
> regards,
> Derick


OK, thanks!
And have you decided anything about 1)? May I help in anything? (personally 
I think that using a float there is a bit overkill in memory usage..)

Nuno
