Whether the right approach, or you can do the job with the date easier. In particular, it is necessary to select a sample of fields from the database, the date of which is between the beginning and the end of the current day, that is, from 00:00:00 to 00:00:00 of the new day. Since it is planned to use in different time zones, I use UTC.
This is how I declare the sampling range
var startOfDay = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day, 0, 0, 0); var endOfDay = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.AddDays(1).Day, 0, 0, 0); Then, I make a query to the database, where I check whether the date of the record belongs to the specified range. In the database, the date is stored in UTC format.