I have an application which potentially rans in different timezones in the world, to name a few it runs in Germany & UK.
Now I have a requirement wherein I have to interpret datetime objects as they are GMT dates, and then get the equivalent UTC datetime out of it. This should happen irrespective of timezones, for example if the application is running in Germany as well the DateTime should be interpreted as GMT and converted to UTC before saving on the server.I do deal will DST shifts as well.
For ex:
If I have a datetime object like this:
var date = new Datetime(2011,03,28,01,00,00)
, this should be converted to it's equivalent UTC.In this case it should be 28/03/2011 01:00:00 +01:00:00
, however while my server reads the saved datetime it finds it as a 28/03/2011 01:00:00 +02:00:00
. My UI was running in Germany at the moment and I suspect the dates were interpreted as local dates(CET).
Can you please advise me how to perform the accurate conversion?