From 7073286008016be98e2550219adc9d34af9dbc9f Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 20 May 2007 16:10:35 +0000 Subject: [PATCH] * Added UnixTimeSinceEpoch() function to Util class (god knows how many times we have reimplemented this.) --- OpenSim.Framework/Util.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OpenSim.Framework/Util.cs b/OpenSim.Framework/Util.cs index 5bf7ff9126..6f609256ce 100644 --- a/OpenSim.Framework/Util.cs +++ b/OpenSim.Framework/Util.cs @@ -36,6 +36,13 @@ namespace OpenSim.Framework.Utilities return id; } + public static int UnixTimeSinceEpoch() + { + TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); + int timestamp = (int)t.TotalSeconds; + return timestamp; + } + //public static int fast_distance2d(int x, int y) //{ // x = System.Math.Abs(x);