Quantcast
Channel: How to remove time portion of date in C# in DateTime object only? - Stack Overflow
Viewing all articles
Browse latest Browse all 42

Answer by Surendra Mishra for How to remove time portion of date in C# in DateTime object only?

$
0
0

When comparing/searching Use .Date on both side. For example:

return await _context.KWhLog.Where(e => e.DateAndTime.Date ==                                                 (shortDateValue.Date)).ToListAsync();

The time parameter will be ignored.


Viewing all articles
Browse latest Browse all 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>