How to find just Current time and just day in mvc [closed]

You can get the Day and Time in DateTime object (datestr). Check datestr object to get more information such as month, year, ShortTimeString.

DateTime datestr = DateTime.Now;
datestr.DayOfWeek; //it shows the day ex: monday,tuesday

datestr.ToLongTimeString(); //restult will be time ex: "10:18:19 PM"

Leave a Comment