The Hidden Cost of DateTime.Now in .NET π°
You're Using DateTime.Nowβββand It's Breaking Your Code β¦β
Let's be honest: We've all written this:
It works⦠until it doesn't.
In production, this little line can wreck your logic due to clock drift, time zone shifts, or mocking nightmares. π
[ Article ] : https://freedium.cfd/https://medium.com/@yaseer.arafat/the-hidden-cost-of-datetime-now-and-what-every-net-developer-should-use-instead-8859863257a1
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#dotnet #csharp
@ProgrammingTip
You're Using DateTime.Nowβββand It's Breaking Your Code β¦
Let's be honest: We've all written this:
if (DateTime.Now > token.Expiry)
{
return Unauthorized();
}
It works⦠until it doesn't.
In production, this little line can wreck your logic due to clock drift, time zone shifts, or mocking nightmares. π
[ Article ] : https://freedium.cfd/https://medium.com/@yaseer.arafat/the-hidden-cost-of-datetime-now-and-what-every-net-developer-should-use-instead-8859863257a1
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#dotnet #csharp
@ProgrammingTip
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
Programming Tips Resources
π .NET 10 is here! π₯
The successor to .NET 9 is now out β and itβs a Long-Term Support (LTS) release, supported for the next 3 years.
π [ Learn whatβs new ] :
https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-10/overview
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#dotnet #csharp #aspnetcore #maui
@ProgrammingTip
The successor to .NET 9 is now out β and itβs a Long-Term Support (LTS) release, supported for the next 3 years.
π [ Learn whatβs new ] :
https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-10/overview
γ°οΈγ°οΈγ°οΈγ°οΈγ°οΈγ°οΈ
#dotnet #csharp #aspnetcore #maui
@ProgrammingTip
Docs
What's new in .NET 10
Learn about the new features introduced in .NET 10 for the runtime, libraries, and SDK. Also find links to what's new in other areas, such as ASP.NET Core.