rj-action-library/Runtime/Time/DateTime/DateMath.cs

28 lines
505 B
C#
Raw Normal View History

2025-06-19 17:22:25 +00:00
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System;
using Godot;
namespace Rokojori
{
public static class DateMath
{
2025-06-23 11:16:01 +00:00
2025-06-19 17:22:25 +00:00
public static float GetDifference( this DateTime a, DateTime b )
{
return (float) ( ( a - b ).TotalSeconds );
}
public static bool HasExpired( this DateTime oldTime, float duration )
{
var difference = GetDifference( DateTime.Now, oldTime );
return difference >= duration;
}
}
}