[New Concept] Dates & Times#500
Conversation
|
To pair with this, I assume we'll port |
|
I've added an Intro, and updated About based on problems I ran into with |
There was a problem hiding this comment.
That's a hefty concept, but it's a complicated topic, so fully understandable. I've just made a few comments that came to mind while reading it, and pointed out some possible formatting issues.
I've only gone through the about.md, so if introduction.md differs in important ways, let me know and I'll pour over that too.
| There are many ways to write dates and times, which tend to be culturally-specific. | ||
| All-number dates such as "7/6/23" are ambiguous, confusing, and have led to many expensive mistakes in multinational organizations (_the author says this from bitter personal experience_). | ||
|
|
||
| The international standard is defined in [`ISO 8601`][wiki-ISO8601], with two main advantages: |
There was a problem hiding this comment.
I know it's implied above and below (and explicit in the link), but I still feel it could be nice to include y/m/d somewhere. Something as simple as:
The international standard (y/m/d) is defined in [
ISO 8601][wiki-ISO8601], with two main advantages:
| sec = 0, | ||
| tz = "UTC" | ||
| ) | ||
|
|
There was a problem hiding this comment.
Here, I assume there was output that was supposed to be shown: #> [1] "1970-01-01 00:00:00 UTC", but I think the example could be clearer as:
make_datetime(
year = 2026L,
month = 4L,
day = 22L,
hour = 17L,
min = 0L,
sec = 0,
tz = "UTC"
)
#> [1] "2026-04-22 17:00:00 UTC"
make_datetime(2026, 4, 22, 17)
#> [1] "2026-04-22 17:00:00 UTC"This is more parallel, but I'm not sure if there was a specific reason for the original difference in the inputs.
There was a problem hiding this comment.
I'm a bit confused. The multi-line bit is a list of defaults, not an example intended to run.
There was a problem hiding this comment.
I guess that was my confusion, since I don't think I've seen that format before. I'm used to everything in a code block either being an input, an output or a comment. For that reason, if that code runs, we may want to consider showing the output (but I don't really mind either way).
| #> [1] Thu | ||
| Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat | ||
| wday(d, label = TRUE, abbr = FALSE) | ||
| #> [1] Thursday | ||
| Levels: Sunday < Monday < Tuesday < Wednesday < Thursday < Friday < Saturday | ||
| ``` |
There was a problem hiding this comment.
Should Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat and Levels: Sunday < Monday < Tuesday < Wednesday < Thursday < Friday < Saturday be prepended with a # or #> [] here?
|
|
||
| ### Periods | ||
|
|
||
| A `period`, such as `hours(3)`, just changes the clock time by adding 3 hours. |
There was a problem hiding this comment.
Just to avoid the word adding (even thought it's technically correct), I think I'd prefer:
A
period, such ashours(3), can be used to increment a clock time by 3 hours.
|
|
||
| ### Durations | ||
|
|
||
| A `duration`, such as `dhours(3)`, advances physical time by 3 hours, respecting irregularities such as DST that cause clock time to deviate from physical time. |
There was a problem hiding this comment.
Again, maybe just replace advances with increments?
|
|
||
| # same clocktime, different tz | ||
| local - AZ | ||
| Time difference of -7 hours |
There was a problem hiding this comment.
Is this output? (I'm not doing this locally, so I'm unsure what the output looks like)
| @@ -0,0 +1,5 @@ | |||
| { | |||
| "authors": ["colinleach"], | |||
There was a problem hiding this comment.
I think the linter might want:
{
"authors": [
"colinleach"
],
I can't even remember what state the intro is in. We'll probably change it in any case, during review of |
|
I've taken these comments and applied them to |
|
I copied the Intro as-is from |
|
Seems OK on the website. Floating, of course (like the regex concept), because |
An incomplete draft at this stage. I learned a lot about the lubridate package while creating the Swift Scheduling and Meetup exercises, so I needed to write it down before I forgot everything.