I want to get midnight time of specific timezone in UTC. For e.g. consider my local machine timezone is +05:30. Please see below screenshot. I used https://www.epochconverter.com/ site for conversion.
In above example I enter midnight time in +05:30 and it give UTCtime for it.
Note: I am resetting my machine timezone to (UTC)Coordinated Universal Time.
So here what I want to find is, that UTC datetime. For this I have stored user timezone information. I get timezone info using below code.
TimeZoneInfo userTz = TimeZoneInfo.FindSystemTimeZoneById(LoginSessionDO.TimeZoneId);
So, I want to find midnight time of any timezone in UTC. How can I do that in c#?
for e.g. +05:30 - 2018-07-07 00:00:00 UTC- 2018-07-06 18:30:00
Sorry for uncleared question. I will explain my scenario.
EDIT:-
I have stored some user's activity data in Sql server
table which contains dateofactivity
column. All records datetime stored in UTC. So in frontend side, I want to fetch all todays activity records of user from midnight(When days start). If user is in +05:30
timezone & he want to fetch all 7th July 2018 00:00:00 records then I need to pass 6th July 2018 18:30:00.Now suppose another user is in Europe/Amsterdam (CEST) GMT +02:00 so want to find midnight time of Europe/Amsterdam in UTC.