How to represent datetime of deifferent time zomes in C#

Posted by Mohoch on Stack Overflow See other posts from Stack Overflow or by Mohoch
Published on 2010-06-17T08:28:53Z Indexed on 2010/06/17 8:33 UTC
Read the original article Hit count: 249

Filed under:
|
|

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!

© Stack Overflow or respective owner

Related posts about c#

Related posts about datetime