How to parse date format?

后端 未结 2 971
盖世英雄少女心
盖世英雄少女心 2021-01-17 06:43

In one of the webservices my application is consuming, I encountered the following DateTime format.

\"/Date(1395780377459)/\"

Is this some stand

2条回答
  •  别那么骄傲
    2021-01-17 06:56

    It looks like a unix timestamp:

    http://www.epochconverter.com/
    
    Tue, 25 Mar 2014 20:46:17 GMT
    

    In .NET:

    var epoch = new DateTime(1970,1,1,0,0,0,0,System.DateTimeKind.Utc);
    var dt = epoch.AddMilliseconds(1395780377459);
    

    (Source: How to convert a Unix timestamp to DateTime and vice versa?)

提交回复
热议问题