var day = value.Date; // a DateTime that will just be whole days
var time = value.TimeOfDay; // a TimeSpan that is the duration into the day
More Related Contents:
- How do I calculate someone’s age based on a DateTime type birthday?
- Parse string to DateTime in C#
- Creating a DateTime in a specific Time Zone in c#
- How to truncate milliseconds off of a .NET DateTime
- C# DateTime.Now precision
- format date in c#
- calculating the difference in months between two dates
- How to get client date and time in ASP.NET?
- What does “DateTime?” mean in C#?
- Format a date in XML via XSLT
- How to compare DateTime in C#?
- Environment.TickCount vs DateTime.Now
- Why DateTime.AddHours doesn’t seem to work?
- Convert DateTime for MySQL using C#
- How to convert Javascript datetime to C# datetime?
- How to find the 3rd Friday in a month with C#?
- How does DateTime.ToUniversalTime() work?
- Convert DateTime to Julian Date in C# (ToOADate Safe?)
- Difference between System.DateTime.Now and System.DateTime.Today
- why does DateTime.ToString(“dd/MM/yyyy”) give me dd-MM-yyyy?
- How to ensure a timestamp is always unique?
- How can I format DateTime to web UTC format?
- datetime to string with time zone
- How frequent is DateTime.Now updated ? or is there a more precise API to get the current time?
- Getting the first and last day of a month, using a given DateTime object
- Days, hours, minutes, seconds between two dates
- Convert Date from Persian to Gregorian
- Unix time conversions in C# [duplicate]
- .NET: Why is TryParseExact failing on Hmm and Hmmss?
- LINQ Query to Convert string to datetime