修改服务器的时区为gmt,将GMT转换为服务器本地时区C#
我正在嘗試將我從ebay API獲得的GMT時(shí)間轉(zhuǎn)換為特定時(shí)區(qū),具體取決于我的應(yīng)用程序托管位置,以便我可以轉(zhuǎn)換并獲取正確的日期(因?yàn)樗鼈儗?shí)際上在ebay以及交易)。
我試圖這樣做的方式:
DateTime convertedDate = DateTime.SpecifyKind(DateTime.Parse(doc2.GetElementsByTagName("CreatedTime").Item(i).InnerText), DateTimeKind.Utc);
order.OrderDate = convertedDate.ToLocalTime();
但這不起作用,因?yàn)槲移诖?.....
有什么建議嗎?
編輯:Sry我正在使用我得到的ebay交易時(shí)間戳,之前我說(shuō)的是Paypal但實(shí)際上是ebay ...現(xiàn)在更正了它..
好的,所以我期待重新創(chuàng)建我在ebay上的圖表,如下所示:
我得到的圖表與eBay上的圖表完全不同,從ebay和該圖表中返回相同的數(shù)據(jù)......
這是他們?cè)趀bay開發(fā)者網(wǎng)站上告訴我的:
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
基于上面的回復(fù),這就是我想要實(shí)現(xiàn)的目標(biāo)......
總結(jié)
以上是生活随笔為你收集整理的修改服务器的时区为gmt,将GMT转换为服务器本地时区C#的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: android关机背景,鍵盤消失后的An
- 下一篇: 虚拟机登服务器,用虚拟机登录云服务器