diff --git a/IntelliTect.Multitool/ReleaseDateAttribute.cs b/IntelliTect.Multitool/ReleaseDateAttribute.cs index b054e37..e5ab34f 100644 --- a/IntelliTect.Multitool/ReleaseDateAttribute.cs +++ b/IntelliTect.Multitool/ReleaseDateAttribute.cs @@ -4,31 +4,34 @@ namespace IntelliTect.Multitool; /// -/// Information about the executing assembly. +/// The release date assembly attribute. /// [AttributeUsage(AttributeTargets.Assembly)] public class ReleaseDateAttribute : Attribute { /// - /// Constructor called from csproj file + /// Constructor that takes in a DateTime string /// - /// A utc O (round-trip date/time) format string + /// A DateTime 'O' (round-trip date/time) format string public ReleaseDateAttribute(string utcDateString) { - ReleaseDate = DateTime.ParseExact(utcDateString, "O", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal); + ReleaseDate = DateTime.ParseExact(utcDateString, "O", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); } + /// /// The date the assembly was built /// public DateTime ReleaseDate { get; } + /// - /// Method to obtain the release date from the assembly attributes + /// Method to obtain the release date from the assembly attribute /// /// An assembly instance - /// The date time from compilation time + /// The date time from the assembly attribute public static DateTime? GetReleaseDate(Assembly? assembly = null) { object[]? attribute = (assembly ?? Assembly.GetEntryAssembly())?.GetCustomAttributes(typeof(ReleaseDateAttribute), false); return attribute?.Length >= 1 ? ((ReleaseDateAttribute)attribute[0]).ReleaseDate : null; } + } \ No newline at end of file