diff options
| author | Julian Hurst <ark@mansus.space> | 2024-10-16 02:31:19 +0200 |
|---|---|---|
| committer | Julian Hurst <ark@mansus.space> | 2024-10-16 02:31:22 +0200 |
| commit | d5c1a74dd5af1398521b2e2b58d55c9277928ab0 (patch) | |
| tree | 030665e76c5c440ce11bfcba41651f0f24dd63f3 /distamp.ha | |
| parent | 299c9cd5a4696bab85291dd61520e65bac8de7a3 (diff) | |
| download | distamp-d5c1a74dd5af1398521b2e2b58d55c9277928ab0.tar.gz | |
Fix locality
Locality in from_str seems broken, it needs to be specified twice with
%L in the layout and as a parameter.
Diffstat (limited to 'distamp.ha')
| -rw-r--r-- | distamp.ha | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -76,7 +76,10 @@ fn printdistamp(i: i64) void = { }; fn abs(s: str) (i64 | date::error) = { - let d = date::from_str("%Y-%m-%d %H:%M:%S", s, chrono::LOCAL)?; + // for some reason locality needs to be specified twice (hare stdlib bug?) + const stz = strings::concat(s, " Europe/Paris"); + defer free(stz); + let d = date::from_str("%Y-%m-%d %T %L", stz, chrono::tz("Europe/Paris")!)?; return time::unix(*(&d: *time::instant)); }; |
