Commit graph

11 commits

Author SHA1 Message Date
lat9nq
25b800e26c time_zone: Clean up includes 2023-07-12 03:03:03 -04:00
lat9nq
0331d580e2 time_zone: Swap subtraction order 2023-07-12 03:02:45 -04:00
lat9nq
9fde7a84ea time_zone: Account for leap years
Protects against invalid hour offsets during transitions to years
following leap years.
2023-07-12 02:34:02 -04:00
lat9nq
efeb79f380 time_zone: Remove string ops for determing zone
MinGW's strftime implementation does not work and cannot be used to
determine the time zone. Besides that, the string operations are
actually unnecessary since we can get the offset from
std::localtime.

Compare localtime to gmtime to find the zone offset on all platforms.
2023-07-10 17:51:34 -04:00
lat9nq
5ab84435dc time_zone: Handle offset time zones
time_zone: Remove maybe_unused

time_zone: Use s64 storages

time_zone: Catch by reference
2023-06-05 15:15:23 -04:00
lat9nq
2c92d48491 common: Move system time zone string detection
Moves it from Settings to Common::TimeZone, since this algorithm doesn't
depend on the setting. It also lets us use it in other libraries.

common: Various fixes

time_zone: Don't double up the std::abs

Too many absolute values were causing mirrored time zones to resolve
as the same.
2023-06-05 15:15:11 -04:00
Morph
2b87305d31 general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
bunnei
55d11a0bfd Revert "common/time_zone: Simplify GetOsTimeZoneOffset()" 2020-08-19 18:27:31 -04:00
Lioncash
89b10968fc common/time_zone: Simplify GetOsTimeZoneOffset()
We can simplify this function down into a single line with the use of
fmt. A benefit with the fmt approach is that the fmt variant of
localtime is thread-safe as well, making GetOsTimeZoneOffset()
thread-safe as well.
2020-08-16 03:58:47 -04:00
bunnei
053399a553 time_zone: Use std::chrono::seconds for strong typing. 2020-05-12 18:44:07 -04:00
bunnei
7aadcb796c common: Add module to get the current time zone. 2020-05-11 17:51:26 -04:00