git » sdk » commit 5500f87

Date: Fix generation of invalid timestamps for time zones ahead of UTC

author Matthew Wild
2024-07-02 16:16:57 UTC
committer Matthew Wild
2024-07-02 16:16:57 UTC
parent 7b1088e6654e28ba50c19a2d16d378f158fe959a

Date: Fix generation of invalid timestamps for time zones ahead of UTC

snikket/Date.hx +1 -1

diff --git a/snikket/Date.hx b/snikket/Date.hx
index 51aeff4..25a3466 100644
--- a/snikket/Date.hx
+++ b/snikket/Date.hx
@@ -7,7 +7,7 @@ class Date {
 		var tzMinute = Std.int(Math.abs(d.getTimezoneOffset())%60);
 		return
 			str + (tzHour < 0 ? "+" : "-") +
-			StringTools.lpad(Std.string(tzHour), "0", 2) + ":" +
+			StringTools.lpad(Std.string(Math.abs(tzHour)), "0", 2) + ":" +
 			StringTools.lpad(Std.string(tzMinute), "0", 2);
 	}
 }