time.localtime() reports local time 1 hour later than actual
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- operating-systems
Research direction
Start by running the reported time.localtime(), time.timezone, time.altzone, and time.daylight examples under IronPython 3 and CPython around the DST boundary. Trace the time module's local-time and timezone conversion entry points; done means IronPython reports the same local hour and timezone values as CPython before and after the transition.
Written by the indexing model from the issue text.
Description
Prerequisites
- Are you running the latest version?
- Are you reporting to the correct repository?
- Did you perform a cursory search?
Description
On the night of DST taking effect in Canada, time.localtime() reports local time 1 hour later than actual.
Steps to Reproduce
import time
t = time.time()
print(time.localtime(t))
Expected behavior:
Output produced by Python 3.4 (correct hour):
time.struct_time(tm_year=2019, tm_mon=3, tm_mday=9, tm_hour=20, tm_min=23, tm_sec=53, tm_wday=5, tm_yday=68, tm_isdst=0)
Further:
print(time.timezone / 3600)
print(time.altzone / 3600)
print(time.daylight)
produces
8.0
7.0
1
Actual behavior:
Output produced by IronPython 3 (incorrect hour):
time.struct_time(tm_year=2019, tm_mon=3, tm_mday=9, tm_hour=21, tm_min=23, tm_sec=53, tm_wday=5, tm_yday=68, tm_isdst=0)
time.timezone has the correct value (28800), but the difference between localtime and gmtime is 7 hours, which is incorrect, until 2:00 AM next day local time, or 10:00 AM today UTC. After that moment the difference will indeed be 7 hours.
Further:
print(time.timezone / 3600)
print(time.altzone / 3600)
print(time.daylight)
produces
8.0
8.0
1
which is different than CPython's output.
Versions
Latest, commit 4a784ac .
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 316
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IronLanguages/ironpython3
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
IronLanguages/ironpython3#2073 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
IronLanguages/ironpython3#2072 · 1 comment ·
-
module-os posix
Difficulty 4/5 3-5 days Newbie friendliness 48/100
IronLanguages/ironpython3#2070 · 1 comment ·
-
What's New In Python 3.2
Difficulty 3/5 1-2 days Newbie friendliness 55/100
IronLanguages/ironpython3#2069 ·
-
module-re What's New In Python 3.7
Difficulty 4/5 3-5 days Newbie friendliness 48/100
IronLanguages/ironpython3#2066 ·
All issues in IronLanguages/ironpython3
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
azurenoops/spin_agent#975 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·