diff options
| author | Teddy Wing | 2018-10-23 15:34:30 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-10-23 15:34:30 +0200 |
| commit | 8369a753e24e1e2d986e9988793655f8923e182c (patch) | |
| tree | 4aae304355324c8ba87589c07ca4beb69e53e8c3 | |
| parent | adc4a2f7a84967541d9da3c2f8edb2814a59ab59 (diff) | |
| download | dome-key-map-8369a753e24e1e2d986e9988793655f8923e182c.tar.bz2 | |
trial: Fix timezone error
Don't apply an offset to converted local times as the offset will
incorrectly shift the correct time. Instead, treat the local time as
0/UTC so that no offset gets applied, even if that's not the correct
local timezone.
| -rw-r--r-- | src/trial.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/trial.rs b/src/trial.rs index 5e398fe..2b535a7 100644 --- a/src/trial.rs +++ b/src/trial.rs @@ -83,7 +83,7 @@ fn initialize_trial_start() -> Result<DateTime<FixedOffset>> { fn datetime_local_to_fixed_offset(d: DateTime<Local>) -> DateTime<FixedOffset> { let offset = FixedOffset::from_offset(d.offset()); - DateTime::<FixedOffset>::from_utc(d.naive_local(), offset) + DateTime::<FixedOffset>::from_utc(d.naive_local(), FixedOffset::east(0)) } /// Decrypts the time string from the trial file and returns it as a |
