Skip to content

Conversation

@mitchcapper
Copy link

Before the DateTime was unknown kind by default which meant if you called file.LastWriteTimeUtc.ToUniversalTime() it would give you a different time compared to file.LastWriteTImeUtc. This isn't 'wrong' in theory as we say it is unknown and it is UTC time but as dotnet generally assumes localtime on unknown datetimes it might confuse the user.

The only one technically wrong was XFS which was implicitly getting the localtime. I would also argue anywhere it got converted to a DateTimeOffset was also 'wrong' because when you convert an unspecified timezone DateTime to a DateTimeOffset it treats it as local and sets DateTimeOffset.Offset to the local offset.

@LTRData
Copy link
Owner

LTRData commented Oct 23, 2025

This looks very good! Thanks a lot for your contribution!

@LTRData LTRData merged commit bcae86b into LTRData:LTRData.DiscUtils-initial Oct 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants