Commit 3e8c222
authored
Adapt Datetime parser to DST timezones (#1524)
When iOS device locale is set to location
which uses different timezeons depending on
daylight saving time (eg PST and PDT for
Los Angeles), then different `gmtoff` applied
by `strptime` for 'summer' and 'winter'
timestamps.
This results in the wrong translation of
datetime string into epoch.
Adapt code to iOS/MacOS behaviour, where
`timegm` updates an input parameter and
erases `gmtoff` value:
- remove logic to infer the offset using epoch
datetime;
- store `gmtoff` value before calling `timegm`;
- offset result returned from `timegm` by
saved `gmtoff`.
Relates-To: HERESDK-2568
Signed-off-by: Mykhailo Diachenko <[email protected]>1 parent e223f22 commit 3e8c222
File tree
2 files changed
+19
-14
lines changed- olp-cpp-sdk-authentication
- src
- tests
2 files changed
+19
-14
lines changedLines changed: 7 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | 126 | | |
134 | 127 | | |
135 | 128 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
| |||
0 commit comments