How to represent datetime of deifferent time zomes in C#
- by Mohoch
Hi.
I have a .NET WebService (written in C#), that is supposed to serve people around the world.
With each request I get the user's datetime in his own time zone with the format : "yyyy/MM/dd HH:mm ZZZZ".
I have to convert the string to something representing the original date and time and specifying the time zone in GMT. I have to make some logical calculations and keep it in the database.
The regular DateTime doe's not support this. it does not have a property specifying the time zone. When I try to convert my string into DateTime - it simply converts it to my local time.
I do not want to keep my time in UTC, because I have some logic that has to run per user by his own time.
Does anyone know a C# class that handles this?
Thanks!