php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76780 wartime correction for india is wrong
Submitted: 2018-08-22 13:05 UTC Modified: 2018-08-22 14:09 UTC
From: astrosanthosh at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: Date/time related
PHP Version: 7.1.21 OS: debian
Private report: No CVE-ID: None
 [2018-08-22 13:05 UTC] astrosanthosh at gmail dot com
Description:
------------
for india there is a wartime correction between September 1, 1942 to October 14, 1945, timezone in this period should be 6.30 and regular timezone for india is 5hours 30 minutes East,
but its showing timezone as 6hours 30min east for a date other than above mentioned period ex. 15 january 1942 timezone should be 05hours 30min east but DateTimeZone() function converting timezone as 6hours 30minutes east

Expected result:
----------------
for india there is a wartime correction between September 1, 1942 to October 14, 1945, timezone in this period should be 6.30 and regular timezone for india is 5hours 30 minutes East,
but its showing timezone as 6hours 30min east for a date other than above mentioned period ex. 15 january 1942 timezone should be 05hours 30min east but DateTimeZone() function converting timezone as 6hours 30minutes east


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-22 13:29 UTC] cmb@php.net
-Status: Open +Status: Feedback -Package: *General Issues +Package: Date/time related -Assigned To: +Assigned To: cmb
 [2018-08-22 13:29 UTC] cmb@php.net
Can't reproduce: <https://3v4l.org/lMs0l>.

Please provide a test script which shows the reported behavior.
 [2018-08-22 13:45 UTC] astrosanthosh at gmail dot com
-Status: Feedback +Status: Assigned
 [2018-08-22 13:45 UTC] astrosanthosh at gmail dot com
here i am giving sample code
$zone = "Asia/Kolkata";
$bdate = "1942-1-115";
$now = new DateTime($bdate, new DateTimeZone($zone));
$timezone1 = $now->getOffset();
$timezone = $now->getOffset()/3600;
$intz = $timezone;
echo($timezone);

reference wikipedia page
https://en.wikipedia.org/wiki/Time_in_India#cite_note-11
 [2018-08-22 13:46 UTC] astrosanthosh at gmail dot com
$zone = "Asia/Kolkata";
$bdate = "1942-1-15";
$now = new DateTime($bdate, new DateTimeZone($zone));
$timezone1 = $now->getOffset();
$timezone = $now->getOffset()/3600;
$intz = $timezone;
echo($timezone);
 [2018-08-22 14:03 UTC] cmb@php.net
-Status: Assigned +Status: Not a bug
 [2018-08-22 14:03 UTC] cmb@php.net
Thanks!

From 1941-09-30 to 1942-05-14 the time for Asia/Kolkata
has been BURT, i.e. UTC+6:30h[1].

[1] <https://www.timeanddate.com/time/zone/india/kolkata?syear=1941>
 [2018-08-22 14:04 UTC] requinix@php.net
-Status: Not a bug +Status: Feedback
 [2018-08-22 14:04 UTC] requinix@php.net
According to
  https://www.timeanddate.com/time/zone/india/kolkata?syear=1925
Jan 15, 1942 was UTC+6:30.

* Oct 1 1941:  +6:30
* May 15 1942: +5:30
* Sep 1 1942:  +6:30
* Oct 15 1945: +5:30
 [2018-08-22 14:05 UTC] requinix@php.net
-Status: Feedback +Status: Not a bug
 [2018-08-22 14:05 UTC] requinix@php.net
.
 [2018-08-22 14:09 UTC] astrosanthosh at gmail dot com
Thanks,
it cleared my doubt, as many Astrology Softwares (I am an Astrologer, so I need to know current and historic timezones) shows wartime correction for the time between September 1, 1942, to October 14, 1945. I use php datetimezone function to get timezones. Now my doubt cleared, its not a bug in php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC