Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C# の Datetime オブジェクトで変換する必要がある UTC 時間文字列があります。
以下のサンプルを試しましたが、うまくいきません。誰でも助けることができますか?
long ticks = long.Parse(ateOn); DateTime ateOnDate = new DateTime(ticks,DateTimeKind.Utc);
ここで、ateOn は文字列の UTC 時間です。
long l = 1360417399227; var dt = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc) .Add(TimeSpan.FromMilliseconds(l));