This seems like a simple problem, but looks to be harder than it seems:
How do I convert Midnight of a specified timezone and convert it to Utc time (regardless of the timezone of the local computer)?
One example: Today Midnight CET is 11pm (the date before) in UTC.
I tried the following:
DateTime midnight = TimeZoneInfo.ConvertTime(DateTime.UtcNow, specifiedTimeZoneInfo).Date;
DateTime utcTime = midnight.ToUniversalTime();
The problem is that this code only works if the timezone of the local computer running the code is the same timezone as used in the TimeZoneInfo.ConvertTime.
How can one do this regardless of the timezone of the local computer?