(375481a35) Write save times as unix time values and display them using the system's current date format

This commit is contained in:
Joonas Rikkonen
2019-05-16 07:03:15 +03:00
parent e42a0a33a4
commit d03e1995bc
12 changed files with 147 additions and 41 deletions
@@ -43,9 +43,9 @@ namespace Barotrauma
private static readonly DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
/// <summary>
/// Returns the current Unix Epoch
/// Returns the current Unix Epoch (Coordinated Universal Time )
/// </summary>
public static int Now
public static int NowUTC
{
get
{
@@ -53,6 +53,17 @@ namespace Barotrauma
}
}
/// <summary>
/// Returns the current Unix Epoch (user's current time)
/// </summary>
public static int NowLocal
{
get
{
return (int)(DateTime.Now.Subtract(epoch).TotalSeconds);
}
}
/// <summary>
/// Convert an epoch to a datetime
/// </summary>