namespace StockSharp.Reporting; using System.Globalization; /// /// Format extensions. /// static class FormatExtensions { /// /// To format the in . /// /// value. /// . public static string Format(this TimeSpan? time) => time?.Format() ?? string.Empty; /// /// To format the in . /// /// value. /// . public static string Format(this TimeSpan time) => time.ToString("c", CultureInfo.InvariantCulture); /// /// To format the in . /// /// value. /// . public static string Format(this DateTime time) // Invariant ISO-8601. The leading '.' before the 'F' specifiers is emitted only when the // fractional part is non-zero, and trailing zero digits are trimmed, so whole-second values // render as 2024-01-15T10:00:00Z - matching the JSON report representation. => time.ToString("yyyy-MM-ddTHH:mm:ss.FFFFFFFK", CultureInfo.InvariantCulture); }