* Added UnixTimeSinceEpoch() function to Util class (god knows how many times we have reimplemented this.)

zircon^2
Adam Frisby 2007-05-20 16:10:35 +00:00
parent 4f26cf8ea2
commit 7073286008
1 changed files with 7 additions and 0 deletions

View File

@ -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);