How do I convert a DateTime from EST/EDT to GMT but I don’t know where the code will be ran (unknown local time zone) and also account for time savings…
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You want TimeZoneInfo.ConvertTimeToUtc(), which allows you to pass the source time zone info as a parameter. For example:
I think this will automatically handle daylight-saving time, but you’ll want to test it to be sure.