This commit is contained in:
2025-07-18 04:25:45 +03:30
parent 9f733c65ad
commit a3d72ed4e2
+16 -2
View File
@@ -1179,6 +1179,13 @@ namespace xCommons.Extensions
var result = DateTimeOffset.FromUnixTimeMilliseconds(timestamp);
return result.DateTime;
}
public static DateTime FromTimestamp(this string source)
{
//
var timestamp = Int64.Parse(source);
var time = timestamp.FromTimestamp();
return time;
}
/// <summary>
/// Check a Date Time is Expired or not
@@ -1188,7 +1195,7 @@ namespace xCommons.Extensions
public static bool IsExPired(this DateTime source)
{
//
if (source == null)
if (source.IsNull())
{
return true;
}
@@ -1202,7 +1209,14 @@ namespace xCommons.Extensions
}
public static bool IsExpired(this long source)
{
return source.FromTimestamp().IsExPired();
var time = source.FromTimestamp();
return time.IsExPired();
}
public static bool IsExpired(this string source)
{
//
var time = DateTime.Parse(source);
return time.IsExPired();
}
/// <summary>