mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-03 12:44:27 +02:00
Updated FAQ (markdown)
2
FAQ.md
2
FAQ.md
@@ -175,7 +175,7 @@ Filling out the `tm_wday` member of `struct tm` with a `weekday` is also easy:
|
||||
tm.tm_wday = (wd - Sunday).count();
|
||||
```
|
||||
|
||||
Indeed, `tm_wday`'s specification says: "days since Sunday — [0, 6]"
|
||||
Indeed, `tm_wday`'s specification says: "days since Sunday — [0, 6]." This formulation works, even if the implementation is encoding `weekday` with [1, 7], because `weekday` difference is specified to be circular (modulo 7).
|
||||
|
||||
As a demonstration of the lowered importance of weekday encoding in calendrical algorithms, see [how to print a calendar](https://github.com/HowardHinnant/date/wiki/Examples-and-Recipes#calendar) which is configurable on the first day of the week. For example here is how to use this code to make Thursday the first day of the week:
|
||||
```c++
|
||||
|
Reference in New Issue
Block a user