I want to compare the time now and time intervals and display in the console in which interval I am.
for example
current time is 18:00
This corresponds to the time slot of evening.
DateTime currectTime = DateTime.Now;
DateTime date1 = new DateTime();
if (currectTime > date1)
{
Console.WriteLine("");
}
else
{
Console.WriteLine("");
}
New contributor
完全に is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1