17 lines
453 B
C#
17 lines
453 B
C#
|
|
namespace System
|
|||
|
|
{
|
|||
|
|
public static class DateTimeExtensions
|
|||
|
|
{
|
|||
|
|
[UnityEngine.Scripting.Preserve]
|
|||
|
|
public static int GetDaysFrom(this DateTime now, DateTime dt)
|
|||
|
|
{
|
|||
|
|
return (int)(now.Date - dt).TotalDays;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[UnityEngine.Scripting.Preserve]
|
|||
|
|
public static int GetDaysFromDefault(this DateTime now)
|
|||
|
|
{
|
|||
|
|
return now.GetDaysFrom(new DateTime(1970, 1, 1).Date);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|