Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Date format for +7

I have this kind of date format:

2022-11-17T15:23:45+07:00

I want to try the following, but I don’t know what format should I use in here for +7?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

 DateTime startDateTime = DateTime.ParseExact(sessionDate, "yyyy-MM-ddTHH:mm:ss",
 System.Globalization.CultureInfo.InvariantCulture).ToUniversalTime();

How to convert it into UTC+0 with C#?

>Solution :

The +7 is the offset relative to UTC.

To convert that to UTC+0:

var utc = DateTime.Parse("2022-11-17T15:23:45+07:00").ToUniversalTime();
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading