mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
* Applying Ahzz's profile patch. Thanks Ahzz!
* Fixed a few bugs in the patch that are sim crashers. * There's still a bug in mySQL mode/ grid mode where the main userprofile text doesn't save.
This commit is contained in:
@@ -181,9 +181,25 @@ namespace OpenSim.Framework
|
||||
|
||||
public static int UnixTimeSinceEpoch()
|
||||
{
|
||||
TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1));
|
||||
int timestamp = (int) t.TotalSeconds;
|
||||
return timestamp;
|
||||
return ToUnixTime(DateTime.UtcNow);
|
||||
}
|
||||
|
||||
public static int ToUnixTime(DateTime stamp)
|
||||
{
|
||||
TimeSpan t = (stamp.ToUniversalTime() - Convert.ToDateTime("1/1/1970 8:00:00 AM"));
|
||||
return (int)t.TotalSeconds;
|
||||
}
|
||||
|
||||
public static DateTime ToDateTime(ulong seconds)
|
||||
{
|
||||
DateTime epoch = Convert.ToDateTime("1/1/1970 8:00:00 AM");
|
||||
return epoch.AddSeconds(seconds);
|
||||
}
|
||||
|
||||
public static DateTime ToDateTime(int seconds)
|
||||
{
|
||||
DateTime epoch = Convert.ToDateTime("1/1/1970 8:00:00 AM");
|
||||
return epoch.AddSeconds(seconds);
|
||||
}
|
||||
|
||||
public static string Md5Hash(string pass)
|
||||
|
||||
Reference in New Issue
Block a user