コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【C#】DateTime が指定された期間内の場合に true を返す拡張メソッド

ソースコード

public static class DateTimeExt
{
    public static bool IsBetween( this DateTime self, DateTime from, DateTime to )
    {
        return from <= value && to >= value;
    }
}