mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-21 22:05:38 -04:00
@@ -4,6 +4,8 @@ namespace NzbDrone.Common.Extensions
|
||||
{
|
||||
public static class DateTimeExtensions
|
||||
{
|
||||
public static readonly DateTime EpochTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
|
||||
public static bool InNextDays(this DateTime dateTime, int days)
|
||||
{
|
||||
return InNext(dateTime, new TimeSpan(days, 0, 0, 0));
|
||||
@@ -43,5 +45,10 @@ namespace NzbDrone.Common.Extensions
|
||||
{
|
||||
return dateTime.AddTicks(-(dateTime.Ticks % TimeSpan.TicksPerSecond));
|
||||
}
|
||||
|
||||
public static DateTime WithTicksFrom(this DateTime dateTime, DateTime other)
|
||||
{
|
||||
return dateTime.WithoutTicks().AddTicks(other.Ticks % TimeSpan.TicksPerSecond);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user