static public DateTime NautTwilightRiseDateTimeUtc(int DayShift = 0) { double tsunrise, tsunset; DateTime CurDate = DateTime.UtcNow; Sunriset.NauticalTwilight(CurDate.AddDays(DayShift).Year, CurDate.AddDays(DayShift).Month, CurDate.AddDays(DayShift).Day, Latitude, Longitude, out tsunrise, out tsunset); return(DateTimeUtils.ConvertToDateTime(tsunrise, DayShift, DateTimeKind.Utc)); }
static public DateTime CivilTwilightSetDateTimeUtc(int DayShift = 0) { double tsunrise, tsunset; DateTime CurDate = DateTime.UtcNow; Sunriset.CivilTwilight(CurDate.AddDays(DayShift).Year, CurDate.AddDays(DayShift).Month, CurDate.AddDays(DayShift).Day, Latitude, Longitude, out tsunrise, out tsunset); //sunsetTime = TimeSpan.FromHours(tsunset); //sunsetTimeString = sunsetTime.ToString(@"hh\:mm\:ss"); return(DateTimeUtils.ConvertToDateTime(tsunset, DayShift, DateTimeKind.Utc)); }