public void SetDespawnTime() { //TODO: DST config option DespawnTime = DisappearTime.FromUnix(); //if (TimeZoneInfo.Local.IsDaylightSavingTime(DespawnTime)) //{ // DespawnTime = DespawnTime.AddHours(1); //DST //} SecondsLeft = DespawnTime.Subtract(DateTime.Now); FirstSeenTime = FirstSeen.FromUnix(); //if (TimeZoneInfo.Local.IsDaylightSavingTime(FirstSeenTime)) //{ // FirstSeenTime = FirstSeenTime.AddHours(1); //DST //} LastModifiedTime = LastModified.FromUnix(); //if (TimeZoneInfo.Local.IsDaylightSavingTime(LastModifiedTime)) //{ // LastModifiedTime = LastModifiedTime.AddHours(1); //} UpdatedTime = Updated.FromUnix(); //if (TimeZoneInfo.Local.IsDaylightSavingTime(Updated)) //{ // UpdatedTime = UpdatedTime.AddHours(1); //} }
/// <summary> /// Set despawn times because .NET doesn't support Unix timestamp deserialization to <seealso cref="DateTime"/> class by default. /// </summary> public void SetDespawnTime() { DespawnTime = DisappearTime.FromUnix(); SecondsLeft = DespawnTime.Subtract(DateTime.Now); FirstSeenTime = FirstSeen.FromUnix(); LastModifiedTime = LastModified.FromUnix(); }
public string ToLine() { // GetHash is also serialized, so file can be interpreted with our eyes better. return(string.Join(':', GetHash(), Transaction.ToHex(), Height, BlockHash, BlockIndex, Label, FirstSeen.ToUnixTimeSeconds(), IsReplacement)); }
/// <summary> /// Set despawn times because .NET doesn't support Unix timestamp deserialization to <seealso cref="DateTime"/> class by default. /// </summary> public void SetDespawnTime() { DespawnTime = DisappearTime.FromUnix() .ConvertTimeFromCoordinates(Latitude, Longitude); SecondsLeft = DespawnTime.Subtract(DateTime.UtcNow.ConvertTimeFromCoordinates(Latitude, Longitude)); FirstSeenTime = FirstSeen .FromUnix() .ConvertTimeFromCoordinates(Latitude, Longitude); LastModifiedTime = LastModified .FromUnix() .ConvertTimeFromCoordinates(Latitude, Longitude); }