Exemplo n.º 1
0
        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);
            //}
        }
Exemplo n.º 2
0
 public void SetTimes()
 {
     UpdatedTime = Updated.FromUnix();
     //if (TimeZoneInfo.Local.IsDaylightSavingTime(Updated))
     //{
     //    UpdatedTime = UpdatedTime.AddHours(1);
     //}
 }
Exemplo n.º 3
0
        /// <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);

            UpdatedTime = Updated
                          .FromUnix()
                          .ConvertTimeFromCoordinates(Latitude, Longitude);
        }
Exemplo n.º 4
0
 public void SetTimes()
 {
     UpdatedTime = Updated
                   .FromUnix()
                   .ConvertTimeFromCoordinates(Latitude, Longitude);
 }