I would like to convert between date-times and timestamps on arbitrary time locations (eg. America/New_York
)
- (Time location, (year, ..., sec)) ==> UTC timestamp
- (UTC timestamp, time location) ==> (year, ..., sec, dayOfWeek)
I'm doing to do these conversions on multiple threads and different time zones. The time locations for a given thread are not changing so I can store some time-zone structures for repeated usage.
I know that the first is ambiguous when a DST change happens (2:30 two or zero times in a day). It would be an extra if a situation like that would be reported, but it is absolutely not a priority.
Update: I would like to have a cross platform solution. Linux + Windows is fine. By arbitrary I mean that it comes from the user and has no relation to the processing machine's location.