Compare commits

..
1 Commits
Author SHA1 Message Date
saherelm 5e31f8f99a add extensions method ... 2026-11-12 23:48:33 +03:30
+20
View File
@@ -1628,6 +1628,26 @@ namespace xCommons.Extensions
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>
/// Determines a File Type is Image Kind or not
/// </summary>