diff options
-rw-r--r-- | OpenSim/Framework/Util.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 52f5432..e8dfec1 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -522,19 +522,17 @@ namespace OpenSim.Framework | |||
522 | public static int ToUnixTime(DateTime stamp) | 522 | public static int ToUnixTime(DateTime stamp) |
523 | { | 523 | { |
524 | TimeSpan t = stamp.ToUniversalTime() - UnixEpoch; | 524 | TimeSpan t = stamp.ToUniversalTime() - UnixEpoch; |
525 | return (int) t.TotalSeconds; | 525 | return (int)t.TotalSeconds; |
526 | } | 526 | } |
527 | 527 | ||
528 | public static DateTime ToDateTime(ulong seconds) | 528 | public static DateTime ToDateTime(ulong seconds) |
529 | { | 529 | { |
530 | DateTime epoch = UnixEpoch; | 530 | return UnixEpoch.AddSeconds(seconds); |
531 | return epoch.AddSeconds(seconds); | ||
532 | } | 531 | } |
533 | 532 | ||
534 | public static DateTime ToDateTime(int seconds) | 533 | public static DateTime ToDateTime(int seconds) |
535 | { | 534 | { |
536 | DateTime epoch = UnixEpoch; | 535 | return UnixEpoch.AddSeconds(seconds); |
537 | return epoch.AddSeconds(seconds); | ||
538 | } | 536 | } |
539 | 537 | ||
540 | /// <summary> | 538 | /// <summary> |