MillisecondsToDateTime() public static method

public static MillisecondsToDateTime ( long unixTimeStamp ) : System.DateTime
unixTimeStamp long
return System.DateTime
コード例 #1
0
 public DdpJsonConverter()
 {
     _readTypes = new Dictionary <Type, Func <JsonReader, object, JsonSerializer, object> >
     {
         [typeof(DdpDate)] = (reader, existingValue, serializer) =>
         {
             JObject ob = JObject.Load(reader);
             return(ob["$date"] == null
                 ? existingValue
                 : new DdpDate
             {
                 DateTime = DdpUtil.MillisecondsToDateTime(ob["$date"].ToObject <long>())
             });
         },
         [typeof(DdpBinary)] = (reader, existingValue, serializer) =>
         {
             JObject ob = JObject.Load(reader);
             return(ob["$binary"] == null
                 ? existingValue
                 : new DdpBinary
             {
                 Data = DdpUtil.GetBytesFromBase64(ob["$binary"].ToObject <string>())
             });
         }
     };
 }