Getting accurate date range

parameter = (DateTime) StartDate, (DateTime) EndDate
DateTime secara default generate Timestamp 00:00:00, sehingga di lokal tambahkan 1 hari pada endDate

DateTime endDate = EndDate.AddDays(1.0);

object = Objects.Where(x => x.Date >= StartDate && x.Date < endDate);
Greater than equal StartDate dan Less than endDate agar mendapatkan date range tepat di antara StartDate dan EndDate

Levanji Prahyudy has written 8 articles

One thought on “Getting accurate date range

Cancel reply

Leave a Reply to Randy Kurnia

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>