⏰ DateTime Best Practices In .NET C# 🎯

➡ While using DateTime, I noticed that sometimes we do mistakes which could be fatal in some occasions.

➡ Read this article to discover most important best practices to follow when dealing with DateTime.

📖 https://DevelopmentSimplyPut.com/post/datetime-best-practices-in-net-c

📭 https://DevelopmentSimplyPut.com/subscribe

#dotnet #softwareengineering #softwarearchitecture #softwaredesign #bestpractices #datetime #developmentsimplyput

DateTime Best Practices In .NET C#

Best practices to follow when using DateTime and DateTimeOffset in DotNet (.NET) CSharp (C#) Code Coding Programming Software Engineering

DevelopmentSimplyPut

@AhmedTarek
A decent starting point. However two bits of feedback:

1. Your abstraction layer is unneeded: use TimeProvider for this purpose. And overloads through the libraries are in place.

2. For anything more that trivial time zone handling, don't use the inbuilt types and make use of NodaTime. Where trivial is nothing more than DST for your system TZ and UTC.

Thanks @richardcox13 for the feedback. I will give it a try 🙂