Converting GMT to Server local time zone C#

583 views Asked by At

I'm trying to convert GMT time that I get from ebay API into a specific time zone , depending on where my application is hosted so that I can convert and get correct dates (As they really are on ebay as well for transactions).

The way I tried to do it:

  DateTime convertedDate = DateTime.SpecifyKind(DateTime.Parse(doc2.GetElementsByTagName("CreatedTime").Item(i).InnerText), DateTimeKind.Utc);
  order.OrderDate = convertedDate.ToLocalTime();

But this is not working as I'm expecting it to ...

Any suggestions guys?

Edit: Sry I'm using ebay timestamp of transaction that I get, previously I said its Paypal but its actually ebay... Corrected it now..

Okay so I was expecting to re-create the graph that I have on my ebay accont like following:

enter image description here

And the graph that I get is nothing alike the one I have on eBay, by returning the same data from ebay and that graph...

This is what they told me on ebay developer site:

The eBay API returns time-stamps for events and transactions in Greenwich Mean Time (GMT).

Your application needs to handle the conversion between GMT and that time zone.

Please refer to the following knowledge base article:

https://ebaydts.com/eBayKBDetails?KBid=76

Regards

And this is what I'm trying to achieve, based on this reply above...

0

There are 0 answers