Skip to content

Commit b8b1eec

Browse files
authored
Merge pull request #1116 from yileicn/master
optimize ConvertToString
2 parents a3efa9c + 14a5415 commit b8b1eec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Infrastructure/BotSharp.Abstraction/Utilities/StringExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ public static string ConvertToString<T>(this T? value, JsonSerializerOptions? js
122122
return s;
123123
}
124124

125+
if (value is DateTime d)
126+
{
127+
return d.ToString("o");
128+
}
129+
125130
if (value is JsonElement elem
126131
&& elem.ValueKind == JsonValueKind.String)
127132
{

0 commit comments

Comments
 (0)