minor simplification of some unix date functions in Util. No functional change.

0.7.6-extended
Justin Clark-Casey (justincc) 2013-09-03 00:17:50 +01:00
parent dbbc260d1a
commit 90907bf4fd
1 changed files with 3 additions and 5 deletions

View File

@ -522,19 +522,17 @@ namespace OpenSim.Framework
public static int ToUnixTime(DateTime stamp)
{
TimeSpan t = stamp.ToUniversalTime() - UnixEpoch;
return (int) t.TotalSeconds;
return (int)t.TotalSeconds;
}
public static DateTime ToDateTime(ulong seconds)
{
DateTime epoch = UnixEpoch;
return epoch.AddSeconds(seconds);
return UnixEpoch.AddSeconds(seconds);
}
public static DateTime ToDateTime(int seconds)
{
DateTime epoch = UnixEpoch;
return epoch.AddSeconds(seconds);
return UnixEpoch.AddSeconds(seconds);
}
/// <summary>