From 5060020197084c448c3346c4c32156ced5f7f0ce Mon Sep 17 00:00:00 2001 From: Konstantin Ivaschenko Date: Fri, 21 Feb 2025 12:31:29 +0300 Subject: [PATCH] [DXFC-413] Incorrect date handling when system calendar is set to Buddhist calendar --- ReleaseNotes.txt | 2 ++ dxf_native/src/CandleDataConnection.cs | 10 +++++----- dxf_native/src/TimeAndSaleDataConnection.cs | 10 +++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 841a5e8..90a39a2 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,3 +1,5 @@ +* [DXFC-413] Incorrect date handling when system calendar is set to Buddhist calendar + Version 8.8.2 * [DXFC-400] Fixed a bug with passing a UNICODE path to a file as a parameter of the logging initialization and settings loading function. - For the changes to work reliably, you need to set the default encoding to UTF-8, for example, as indicated by the link: diff --git a/dxf_native/src/CandleDataConnection.cs b/dxf_native/src/CandleDataConnection.cs index 74069bb..afb0c83 100644 --- a/dxf_native/src/CandleDataConnection.cs +++ b/dxf_native/src/CandleDataConnection.cs @@ -11,6 +11,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Net; using System.Text; @@ -126,11 +127,10 @@ private static string CreateQuery(IEnumerable symbols, DateTime fr { return "records=Candle&" + $"symbols={string.Join(",", symbols).Replace("&", "[%26]")}&" + - $"start={fromTime.ToUniversalTime():yyyyMMdd-HHmmss}Z&" + - $"stop={toTime.ToUniversalTime():yyyyMMdd-HHmmss}Z&" + + $"start={fromTime.ToUniversalTime().ToString("yyyyMMdd-HHmmss", CultureInfo.InvariantCulture)}Z&" + + $"stop={toTime.ToUniversalTime().ToString("yyyyMMdd-HHmmss", CultureInfo.InvariantCulture)}Z&" + "format=binary&" + - "compression=zip&" + - "skipServerTimeCheck"; + "compression=zip"; } } -} \ No newline at end of file +} diff --git a/dxf_native/src/TimeAndSaleDataConnection.cs b/dxf_native/src/TimeAndSaleDataConnection.cs index 4f2f111..6417969 100644 --- a/dxf_native/src/TimeAndSaleDataConnection.cs +++ b/dxf_native/src/TimeAndSaleDataConnection.cs @@ -11,6 +11,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Net; using System.Text; @@ -125,11 +126,10 @@ private static string CreateQuery(IEnumerable symbols, DateTime fromTime { return "records=TimeAndSale&" + $"symbols={string.Join(",", symbols).Replace("&", "[%26]")}&" + - $"start={fromTime.ToUniversalTime():yyyyMMdd-HHmmss}Z&" + - $"stop={toTime.ToUniversalTime():yyyyMMdd-HHmmss}Z&" + + $"start={fromTime.ToUniversalTime().ToString("yyyyMMdd-HHmmss", CultureInfo.InvariantCulture)}Z&" + + $"stop={toTime.ToUniversalTime().ToString("yyyyMMdd-HHmmss", CultureInfo.InvariantCulture)}Z&" + "format=binary&" + - "compression=zip&" + - "skipServerTimeCheck"; + "compression=zip"; } } -} \ No newline at end of file +}