Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit b49ded2

Browse files
committed
Add overload for FromUnixTime(long)
1 parent a6ef1e1 commit b49ded2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ServiceStack.Text/DateTimeExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ public static DateTime FromUnixTime(this double unixTime)
3636
return UnixEpochDateTimeUtc + TimeSpan.FromSeconds(unixTime);
3737
}
3838

39+
public static DateTime FromUnixTime(this long unixTime)
40+
{
41+
return UnixEpochDateTimeUtc + TimeSpan.FromSeconds(unixTime);
42+
}
43+
3944
public static long ToUnixTimeMsAlt(this DateTime dateTime)
4045
{
4146
return (dateTime.ToStableUniversalTime().Ticks - UnixEpoch) / TimeSpan.TicksPerMillisecond;

0 commit comments

Comments
 (0)