- Home /
Question by
smtabatabaie · Jun 25, 2014 at 06:38 PM ·
timedate
Compare two dates
Hi , is there any way to compare DateTime.Now to a specific time like 01/01/2015 ?
thanks very much
Comment
Answer by roojerry · Jun 25, 2014 at 06:57 PM
if(DateTime.Now.Equals(new DateTime(1,1,2015)))
That will check for equality down to the tick. If you don't need it that fine, just compare the DateTime components you need to be equal
Thanks , I need to know if it's before or after, I think it can be done via DateTime.Now.CompareTo .
Your answer
Follow this Question
Related Questions
Game Which Adapts Via Real-Life Date & Time 0 Answers
In game clock/Time 1 Answer
Do if after date. 2 Answers
WebGL - Get "host"/"server" time and date? 2 Answers
Access the system time on mobile 1 Answer