diff --git a/Snowflake.Data.Tests/IntegrationTests/SFBindTestIT.cs b/Snowflake.Data.Tests/IntegrationTests/SFBindTestIT.cs index e60f8f4e1..d0640f4e2 100755 --- a/Snowflake.Data.Tests/IntegrationTests/SFBindTestIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/SFBindTestIT.cs @@ -896,7 +896,7 @@ public void TestDateTimeBinding(ResultFormat resultFormat, SFTableType tableType var timestamp = "2023/03/15 13:17:29.207 +05:00"; // 08:17:29.207 UTC var expected = ExpectedTimestampWrapper.From(timestamp, columnType); var columnWithPrecision = ColumnTypeWithPrecision(columnType, columnPrecision); - var testCase = $"TableType={tableType}, ColumnType={columnWithPrecision}, BindingType={bindingType}, ComparisonFormat={comparisonFormat}"; + var testCase = $"ResultFormat={resultFormat}, TableType={tableType}, ColumnType={columnWithPrecision}, BindingType={bindingType}, ComparisonFormat={comparisonFormat}"; var bindingThreshold = 65280; // when exceeded enforces bindings via file on stage var smallBatchRowCount = 2; var bigBatchRowCount = bindingThreshold / 2; diff --git a/Snowflake.Data.Tests/Util/DbCommandTestExtensions.cs b/Snowflake.Data.Tests/Util/DbCommandExtensions.cs similarity index 90% rename from Snowflake.Data.Tests/Util/DbCommandTestExtensions.cs rename to Snowflake.Data.Tests/Util/DbCommandExtensions.cs index 30e432028..fb336d5c3 100644 --- a/Snowflake.Data.Tests/Util/DbCommandTestExtensions.cs +++ b/Snowflake.Data.Tests/Util/DbCommandExtensions.cs @@ -2,7 +2,7 @@ namespace Snowflake.Data.Tests.Util { - public static class DbCommandTestExtensions + public static class DbCommandExtensions { internal static IDbDataParameter Add(this IDbCommand command, string name, DbType dbType, object value) { diff --git a/Snowflake.Data.Tests/Util/DbConnectionTestExtensions.cs b/Snowflake.Data.Tests/Util/DbConnectionExtensions.cs similarity index 93% rename from Snowflake.Data.Tests/Util/DbConnectionTestExtensions.cs rename to Snowflake.Data.Tests/Util/DbConnectionExtensions.cs index 54e91e6f3..02b7e47dd 100644 --- a/Snowflake.Data.Tests/Util/DbConnectionTestExtensions.cs +++ b/Snowflake.Data.Tests/Util/DbConnectionExtensions.cs @@ -2,7 +2,7 @@ namespace Snowflake.Data.Tests.Util { - public static class DbConnectionTestExtensions + public static class DbConnectionExtensions { internal static IDbCommand CreateCommand(this IDbConnection connection, string commandText) { diff --git a/Snowflake.Data.Tests/Util/TableTypeTestExtensions.cs b/Snowflake.Data.Tests/Util/TableTypeExtensions.cs similarity index 96% rename from Snowflake.Data.Tests/Util/TableTypeTestExtensions.cs rename to Snowflake.Data.Tests/Util/TableTypeExtensions.cs index 94c392758..4c00f3a1d 100644 --- a/Snowflake.Data.Tests/Util/TableTypeTestExtensions.cs +++ b/Snowflake.Data.Tests/Util/TableTypeExtensions.cs @@ -10,7 +10,7 @@ public enum SFTableType Iceberg } - static class TableTypeTestExtensions + static class TableTypeExtensions { internal static string TableDDLCreationPrefix(this SFTableType val) => val == SFTableType.Standard ? "" : val.ToString().ToUpper(); diff --git a/Snowflake.Data/Core/SFBindUploader.cs b/Snowflake.Data/Core/SFBindUploader.cs index b9b5f1cd1..fed229f5e 100644 --- a/Snowflake.Data/Core/SFBindUploader.cs +++ b/Snowflake.Data/Core/SFBindUploader.cs @@ -230,7 +230,7 @@ internal string GetCSVData(string sType, string sValue) if (sValue == null) return sValue; - DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified); + DateTime epoch = SFDataConverter.UnixEpoch; switch (sType) { case "TEXT": @@ -265,9 +265,9 @@ internal string GetCSVData(string sType, string sValue) string[] tstzString = sValue.Split(' '); long nsFromEpochTz = long.Parse(tstzString[0]); // SFDateConverter provides in [ns] from Epoch int timeZoneOffset = int.Parse(tstzString[1]) - 1440; // SFDateConverter provides in minutes increased by 1440m - DateTime timestamp = epoch.AddTicks(nsFromEpochTz/100); + DateTime timestamp = epoch.AddTicks(nsFromEpochTz/100).AddMinutes(timeZoneOffset); TimeSpan offset = TimeSpan.FromMinutes(timeZoneOffset); - DateTimeOffset tzDateTimeOffset = new DateTimeOffset(timestamp.AddMinutes(timeZoneOffset), offset); + DateTimeOffset tzDateTimeOffset = new DateTimeOffset(timestamp.Year, timestamp.Month, timestamp.Day, timestamp.Hour, timestamp.Minute, timestamp.Second, timestamp.Millisecond, offset); return tzDateTimeOffset.ToString("yyyy-MM-dd HH:mm:ss.fffffff zzz"); } return sValue;