javascript-tutorial / javascript-tutorial/en.javascript.info

Date and time tasks don't make sense (if not in UTC)

Open
#3,561 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
25.5k
Forks
4k
PR merge metrics
No merged PRs in 30d

Description

Maybe there's an error in my logic.
But all the tasks & solutions in [*Date and time*](https://javascript.info/date#tasks) don't really make sense if you aren't coincidentally living in UTC+0, right?

My Win 10 always displays dates with 1 hour delay (because I'm in central European summer time UTC+1):
`console.log(new Date(2012,2,1)) ` doesn't display 1st of March but `2012-02-29T23:00:00.000Z`

Shouldn't the tasks explicitly work with UTC time zone & the respective methods, in order to make results inclusive?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Date and time tasks section linked in the issue and review each task's assumptions about local time, UTC, and the Date methods used. Reproduce the examples in a non-UTC timezone, then update the task wording or examples so the intended timezone is explicit and the stated results are consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.