aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-09-03 00:17:50 +0100
committerJustin Clark-Casey (justincc)2013-09-03 00:17:50 +0100
commit431156f6c48944c79e3f56c54d64e7f3bc748f7b (patch)
tree20ef0ab7d4e59e86e178a8a13ff360d21bbd0a9c
parentFix logic errors in "show grid users online" console command which didn't act... (diff)
downloadopensim-SC-431156f6c48944c79e3f56c54d64e7f3bc748f7b.zip
opensim-SC-431156f6c48944c79e3f56c54d64e7f3bc748f7b.tar.gz
opensim-SC-431156f6c48944c79e3f56c54d64e7f3bc748f7b.tar.bz2
opensim-SC-431156f6c48944c79e3f56c54d64e7f3bc748f7b.tar.xz
minor simplification of some unix date functions in Util. No functional change.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs8
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>