mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-13 19:55:02 +00:00
fix: Program and Processor utils actually return DateTimes for date properties
This commit is contained in:
committed by
Chris Cameron
parent
69eb4b3d34
commit
49d12d454f
@@ -1,4 +1,5 @@
|
||||
using ICD.Common.Utils.Services;
|
||||
using ICD.Common.Utils.IO;
|
||||
using ICD.Common.Utils.Services;
|
||||
using ICD.Common.Utils.Services.Logging;
|
||||
#if SIMPLSHARP
|
||||
using Crestron.SimplSharp;
|
||||
@@ -40,7 +41,16 @@ namespace ICD.Common.Utils
|
||||
/// Gets the compile date of the program.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public static string CompiledDate { get { return ProgComments.GetDefault(COMPILED_ON_KEY, null); } }
|
||||
public static DateTime CompiledDate
|
||||
{
|
||||
get
|
||||
{
|
||||
string dateString;
|
||||
return ProgComments.TryGetValue(COMPILED_ON_KEY, out dateString)
|
||||
? DateTime.Parse(dateString).ToUniversalTime()
|
||||
: DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the compiler revision version.
|
||||
@@ -86,6 +96,16 @@ namespace ICD.Common.Utils
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the date and time the program was installed.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[PublicAPI]
|
||||
public static DateTime ProgramInstallDate
|
||||
{
|
||||
get { return IcdFile.GetCreationTime(PathUtils.Join(PathUtils.ProgramPath, ProgramFile)).ToUniversalTime(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses the prog comments and pulls program information.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user