aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--distamp.ha5
1 files changed, 4 insertions, 1 deletions
diff --git a/distamp.ha b/distamp.ha
index 1609419..fc5cf28 100644
--- a/distamp.ha
+++ b/distamp.ha
@@ -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));
};