Skip to content

Commit

Permalink
improve datetime merge
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed May 6, 2024
1 parent 5fc18df commit 909ca23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/FluentCommand.SqlServer/Merge/DataMergeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ private static string GetValue(object value)
return value switch
{
string stringValue => stringValue,
DateTime dateTimeValue => dateTimeValue.ToString("u"),
DateTimeOffset dateTimeOffset => dateTimeOffset.ToString("u"),
DateTime dateTimeValue => dateTimeValue.ToString("yyyy-MM-dd HH:mm:ss.fff"),
DateTimeOffset dateTimeOffset => dateTimeOffset.ToString("yyyy-MM-dd HH:mm:ss.ffffffzzz"),
byte[] byteArray => ToHex(byteArray),
bool boolValue => boolValue ? "1" : "0",
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
USING
(
VALUES
(1, 'Test1', 0, 2, 200, 200.2, 300.35, 456.12, '2024-05-01 08:00:00Z', '2024-05-01 14:00:00Z', '00000000-0000-0000-0000-000000000000', '01:00:00', '2022-12-01', '01:30:00.000000', 0, 2, 200, 200.2, 300.35, 456.12, '2024-04-01 08:00:00Z', '2024-04-01 14:00:00Z', '00000000-0000-0000-0000-000000000000', '01:00:00', '2022-12-01', '01:30:00.000000'),
(2, 'Test2', 1, 3, 400, 600.2, 700.35, 856.12, '2024-05-01 08:00:00Z', '2024-05-01 14:00:00Z', '00000000-0000-0000-0000-000000000000', '02:00:00', '2022-12-12', '06:30:00.000000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
(1, 'Test1', 0, 2, 200, 200.2, 300.35, 456.12, '2024-05-01 08:00:00.000', '2024-05-01 08:00:00.000000-06:00', '00000000-0000-0000-0000-000000000000', '01:00:00', '2022-12-01', '01:30:00.000000', 0, 2, 200, 200.2, 300.35, 456.12, '2024-04-01 08:00:00.000', '2024-04-01 08:00:00.000000-06:00', '00000000-0000-0000-0000-000000000000', '01:00:00', '2022-12-01', '01:30:00.000000'),
(2, 'Test2', 1, 3, 400, 600.2, 700.35, 856.12, '2024-05-01 08:00:00.000', '2024-05-01 08:00:00.000000-06:00', '00000000-0000-0000-0000-000000000000', '02:00:00', '2022-12-12', '06:30:00.000000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
)
AS s
(
Expand Down

0 comments on commit 909ca23

Please sign in to comment.