* Added UnixTimeSinceEpoch() function to Util class (god knows how many times we have reimplemented this.)
parent
4f26cf8ea2
commit
7073286008
|
@ -36,6 +36,13 @@ namespace OpenSim.Framework.Utilities
|
||||||
return id;
|
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)
|
//public static int fast_distance2d(int x, int y)
|
||||||
//{
|
//{
|
||||||
// x = System.Math.Abs(x);
|
// x = System.Math.Abs(x);
|
||||||
|
|
Loading…
Reference in New Issue