Hello,
I'm in Prague,Czech Republic (UTC+1) with correct php datime zone "Europe/Belgrade", but PHP Manager suggests me that I should have "Asia/Kuwait", which is UTC+3.
The problem seems to be here:
if (localZone.IsDaylightSavingTime(currentTime))
{
DaylightTime daylightTime = localZone.GetDaylightChanges(currentTime.Year);
if (offset >= TimeSpan.Zero)
{
offset += daylightTime.Delta;
}
else
{
offset -= daylightTime.Delta;
}
}
I think it should always subtract daylightTime.Delta from offset to get correct UTC offset without dayling saving time. In my case offset would be correctly 1, not 3.
Thank you,
Miloslav
I'm in Prague,Czech Republic (UTC+1) with correct php datime zone "Europe/Belgrade", but PHP Manager suggests me that I should have "Asia/Kuwait", which is UTC+3.
The problem seems to be here:
if (localZone.IsDaylightSavingTime(currentTime))
{
DaylightTime daylightTime = localZone.GetDaylightChanges(currentTime.Year);
if (offset >= TimeSpan.Zero)
{
offset += daylightTime.Delta;
}
else
{
offset -= daylightTime.Delta;
}
}
I think it should always subtract daylightTime.Delta from offset to get correct UTC offset without dayling saving time. In my case offset would be correctly 1, not 3.
Thank you,
Miloslav