# Win32 sendmail.c doesn't respect DST

- Thread: https://externals.io/message/12752
- Original archive: https://news-web.php.net/php.internals/12752
- Started by Carter on 2004-09-13T07:15:13+00:00
- Messages: 2
- 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

---

## #12752 — Carter — 2004-09-13T07:15:13+00:00

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

Patch attached for this. Can someone validate my thinking, test and commit if possible?

Is it too late for 4.3.9?

Cheers,

John.
 <<sendmail.c.diff>> 
John Carter
john.carter@royal-london.co.uk
Analyst Programmer Integro Team
IT Department
Royal London
(44) 1625 605735

> -----Original Message-----
> From:	Carter, John 
> Sent:	09 September 2004 10:01
> To:	internals@lists.php.net
> Subject:	[PHP-DEV] Win32 sendmail.c doesn't respect DST
> 
> Hi,
> 
> (Long time lurker, first time poster).
> 
> *Windows only* 4.3.9rc2
> 
> sendmail.c sets the date header if you don't supply one, unfortunately it doesn't respect DST:
> 
> I'm in the UK in daylight savings time (i.e. GMT+1)
> 
> So the time is 09:50, i.e. 09:50 GMT +0100 (08:50 GMT)
> 
> The current mail header code gives 09:50 GMT +0000 which isn't right. The fix looks easy, change the code below:
> 
> 	zoneh /= (60 * 60);
> 	zonem = (abs(_timezone) / 60) - (zoneh * 60);
> to:
> 	zoneh /= (60 * 60);
> 	zonem = (abs(_timezone) / 60) - (zoneh * 60);
> 	zoneh += tm->tm_isdst;
> 
> in the PostHeader function.
> 
> I'm waiting to be proved wrong in the most embarrassing way possible (particularly as the code has been like this for 8 years).
> 
> Thanks,
> 
> John.
> 
> John Carter
> john.carter@royal-london.co.uk
> Analyst Programmer Integro Team
> IT Department
> Royal London
> (44) 1625 605735
> 
> 
> 
> The contents of this e-mail are confidential and for the addressee only.
> If you are not the addressee you should not print, copy or distribute
> this e-mail or use it or its contents or copy or publish its contents
> to any other person.  If you have received this e-mail in error please
> notify us and delete it from your system.
> 
> The Royal London Mutual Insurance Society Limited for life and pension
> products. Registered in England No. 99064. Registered Office: 
> 55 Gracechurch Street, London, EC3V 0RL. Royal London Asset Management Limited
> for investment management services. Registered in England No. 2244297.
> Registered Office: 55 Gracechurch Street, London, EC3V 0UF.
> Royal London Savings Limited for Individual Savings Accounts.
> Registered in England No. 3642633. Registered Office: 55 Gracechurch Street, 
> London, EC3V 0RL. Royal London Unit Trust Managers Limited
> for unit trusts. Registered in England No. 2372439.
> Registered Office: 55 Gracechurch Street, London, EC3V 0UF.
> All these companies are authorised and regulated by the Financial Services Authority.

---

## #12754 — Derick Rethans — 2004-09-13T08:04:32+00:00

URL: https://externals.io/message/12752#12754 · In reply to: #12752

> Patch attached for this. Can someone validate my thinking, test and commit if possible?

No patch here, make sure to attach it as text/plain as our maillinglist
software strips everything else.

You can also put it on a webspace and provide a URL to it here.

Derick

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