mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
* Added UnixTimeSinceEpoch() function to Util class (god knows how many times we have reimplemented this.)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user