diff options
author | Justin Clark-Casey (justincc) | 2013-09-03 00:17:50 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-09-04 00:47:26 +0100 |
commit | 90907bf4fd1db04d388b6b7bfa9f9ca6004d815c (patch) | |
tree | d5dd229f88745d9fcf3e1d1935f8b8f8498c82e1 | |
parent | Fix logic errors in "show grid users online" console command which didn't act... (diff) | |
download | opensim-SC_OLD-90907bf4fd1db04d388b6b7bfa9f9ca6004d815c.zip opensim-SC_OLD-90907bf4fd1db04d388b6b7bfa9f9ca6004d815c.tar.gz opensim-SC_OLD-90907bf4fd1db04d388b6b7bfa9f9ca6004d815c.tar.bz2 opensim-SC_OLD-90907bf4fd1db04d388b6b7bfa9f9ca6004d815c.tar.xz |
minor simplification of some unix date functions in Util. No functional change.
-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> |