public override string ToString()
    {
        var strBuilder = new StringBuilder();

        strBuilder.AppendFormat("Погода в городе {0} на данный момент:", CityName).AppendLine()
        .AppendFormat("Описание: {0}", Info[0].Description).AppendLine()
        .AppendFormat("Температура: {0:+#;-#;0}°С", Weather.Temperature);
        if (Weather.FeelsLike.HasValue)
        {
            strBuilder.AppendFormat(" (ощущается как {0:+#;-#;0}°С)", Weather.FeelsLike);
        }

        strBuilder.AppendLine()
        .AppendFormat("Влажность: {0}%", Weather.Humidity).AppendLine()
        .AppendFormat("Ветер: {0:N0} м/с", Wind.Speed).AppendLine()
        .AppendFormat("Давление: {0:N0} мм.рт.ст", Weather.Pressure * Defaults.PressureConvert)
        .AppendLine()
        .AppendFormat("Облачность: {0}%", Clouds.Cloudiness).AppendLine()
        .AppendFormat("Видимость: {0} метров", Visibility).AppendLine()
        .AppendLine()
        .AppendFormat("Восход: {0:HH:mm}", OtherInfo.Sunrise.AddSeconds(TimezoneDifference)).AppendLine()
        .AppendFormat("Закат: {0:HH:mm}", OtherInfo.Sunset.AddSeconds(TimezoneDifference)).AppendLine()
        .AppendLine()
        .AppendFormat("Данные обновлены {0:dd.MM.yyyy HH:mm}", UnixTime.AddSeconds(TimezoneDifference));

        return(strBuilder.ToString());
    }
Exemple #2
0
 public static DateTime GetDateTimeFromTimestamp(long timestamp)
 {
     return(UnixTime.AddSeconds(timestamp));
 }