Try this, if you use a DateTimeOffset, it will also take care of the timezone
date1 = date1.LocalDateTime.Date;If you need to add hours, use this:
date1 = date1.LocalDateTime.Date;date1 = date1.AddHours(23).AddMinutes(59).AddSeconds(59);
Try this, if you use a DateTimeOffset, it will also take care of the timezone
date1 = date1.LocalDateTime.Date;If you need to add hours, use this:
date1 = date1.LocalDateTime.Date;date1 = date1.AddHours(23).AddMinutes(59).AddSeconds(59);