How to get week number since epoch? Like millis?
I'm modeling a weekly reporting store in DynamoDb.
I'm thinking the best way to identify the report-records is by their respective week number since 1970. Much like epoch milliseconds.
Therefore:
- How to get to the current week number since 1970?
- How to get start and end dates given such week number?
Considering all the possible edge cases I might not be aware of, like daylight savings and similar, I'm quite uncomfortable trying to solve this.
Clarifications:
- Week starts Sunday night at midnight.
- In order to work out the exact time, the function 1. receives the desired UTC offset in minutes. (I'm open to suggestions here)