From 4815275f4fad06b7262d606839af6b5b2db7624d Mon Sep 17 00:00:00 2001 From: zornwal Date: Wed, 26 Jan 2022 15:41:25 +0100 Subject: [PATCH 1/2] Escape date/time separators Escape date and time separators to avoid using system/culture defaults. --- src/Twilio/Converters/Serializers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Twilio/Converters/Serializers.cs b/src/Twilio/Converters/Serializers.cs index f5360c35d..230e6a6cb 100644 --- a/src/Twilio/Converters/Serializers.cs +++ b/src/Twilio/Converters/Serializers.cs @@ -29,7 +29,7 @@ public static string DateTimeIso8601(DateTime? input) { if (input == null) return null; - return input.Value.ToString("yyyy-MM-ddTHH:mm:ssZ"); + return input.Value.ToString("yyyy'-'MM'-'ddTHH':'mm':'ssZ"); } public static string Url(Uri input) From 75fe11668d72b7bba138d252aad280e4187dd647 Mon Sep 17 00:00:00 2001 From: zornwal Date: Wed, 26 Jan 2022 15:46:18 +0100 Subject: [PATCH 2/2] Add comment --- src/Twilio/Converters/Serializers.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Twilio/Converters/Serializers.cs b/src/Twilio/Converters/Serializers.cs index 230e6a6cb..fc41432cc 100644 --- a/src/Twilio/Converters/Serializers.cs +++ b/src/Twilio/Converters/Serializers.cs @@ -28,7 +28,8 @@ public static string JsonObject(object input) public static string DateTimeIso8601(DateTime? input) { if (input == null) return null; - + + // Explicitly escape separators to avoid using system/culture defaults. return input.Value.ToString("yyyy'-'MM'-'ddTHH':'mm':'ssZ"); }