add extensions method ...
This commit is contained in:
@@ -1628,6 +1628,26 @@ namespace xCommons.Extensions
|
|||||||
return time.IsExPired();
|
return time.IsExPired();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check Specified Time is Expired or not ...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="source"></param>
|
||||||
|
/// <param name="ttlSeconds"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool IsExpiredTTL(
|
||||||
|
this DateTime source,
|
||||||
|
int ttlSeconds
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
var now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
||||||
|
var result = new DateTimeOffset(source)
|
||||||
|
.ToUnixTimeSeconds() < now + ttlSeconds;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines a File Type is Image Kind or not
|
/// Determines a File Type is Image Kind or not
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user