Skip to content

Commit f53fb7b

Browse files
committed
fix: remove forced UTC conversion for DateTimeKind.Unspecified DateTime
1 parent 2c5f9f1 commit f53fb7b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
- Tests target .NET Core 6.0-9.0
1111
* config: update SFDC API default to v64.0
1212
* content: Updated default SFDC object models in NetCoreForce.Models to SF API v64.0
13+
* fix: remove forced UTC conversion for DateTimeKind.Unspecified DateTimes.
14+
this caused inconsistent behavior between Windows and other platforms as under Windows it would end up adding a utc offset to the date.
15+
NetCoreForce.Client.Tests.DateFormatTests.FullDateFormatFromDateTime
16+
Expected: "2018-01-01T00:00:00+00:00"
17+
Actual: "2018-01-01T00:00:00-05:00" (under Windows)
1318

1419
### 2025-02-24 v5.0.0-Beta
1520

src/NetCoreForce.Client/DateFormats.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static string FullDateString(DateTimeOffset dto)
5454
/// <returns></returns>
5555
public static string FullDateString(DateTime dt)
5656
{
57-
return dt.ToUniversalTime().ToString(_FullFormat);
57+
return dt.ToString(_FullFormat);
5858
}
5959

6060
public static string FullDateString(DateTime dt, TimeSpan offset)

0 commit comments

Comments
 (0)