Compare Created DateTime to DateTime.Today at 6pm, C#
Posted
by Refracted Paladin
on Stack Overflow
See other posts from Stack Overflow
or by Refracted Paladin
Published on 2010-05-24T17:38:23Z
Indexed on
2010/05/24
17:41 UTC
Read the original article
Hit count: 245
In C# I need to compare the value of DateTime.Today
/6pm, to a field that stores the Created DateTime
.
Basically there is certain functionality that is only accessible on the same day as the created day and then only till 6pm.
The part I am not fully understanding is how to accurately represent 6pm on Today to compare against. Is there a method that always returns, say, Midnight that I can then do a .AddHours(18);
to?
Am I over-complicating this? Thanks.
© Stack Overflow or respective owner