last ...
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user