28 lines
505 B
C#
28 lines
505 B
C#
|
|
using System.Diagnostics;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System;
|
|
using Godot;
|
|
|
|
|
|
namespace Rokojori
|
|
{
|
|
public static class DateMath
|
|
{
|
|
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
} |