From b25bc5d23b9381fc7bf8b09d1a73ecec4943f866 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Wed, 22 Mar 2023 10:55:40 -0700 Subject: [PATCH 1/3] Add more Release Date examples --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a1b14d1..9527739 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,26 @@ * ReleaseDateAttribute: Gets an UTC DateTime from compile time. * Example Usage: - + + ```cs + // Simple assignment of GetReleaseDate() to a local variable + DateTime? date = IntelliTect.Multitool.ReleaseDateAttribute.GetReleaseDate(); // Returns a datetime in UTC to date + ``` + ```cshtml // This example is in cshtml. - @ReleaseDateAttribute.GetReleaseDate() // Returns a time in UTC + @ReleaseDateAttribute.GetReleaseDate() // Returns a datetime in UTC ``` + + ```cshtml + // convert this UTC DateTime object into one for my local timezone that is formatted in a “d MMM, yyyy h:mm:ss tt” (ex: 8 Feb, 2023 11:36:31 AM). + // The following code will format the date and convert it to my local time zone of Pacific Standard Time. + Build: @if (IntelliTect.Multitool.ReleaseDateAttribute.GetReleaseDate() is DateTime date) + { + @TimeZoneInfo.ConvertTimeFromUtc(date, TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time")).ToString("d MMM, yyyy h:mm:ss tt", CultureInfo.InvariantCulture) + } + // Result is "Build: 8 Feb, 2023 11:36:31 AM" + ``` * RepositoryPaths: Provides consistent environment-independent normalized pathing within a repository. * Example Usage: From e72332c1c1475313e11714e409e0d88ac7199ce5 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Wed, 22 Mar 2023 10:57:01 -0700 Subject: [PATCH 2/3] Minor namespace adjustment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9527739..e9b347c 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ ```csharp // In this case, the GetDefaultRepoRoot() method can be used to get the root of a repository. - string fullPathToTheFile = Path.Combine(RepositoryPaths.GetDefaultRepoRoot(), "TheFile.txt"); + string fullPathToTheFile = Path.Combine(IntelliTect.Multitool.RepositoryPaths.GetDefaultRepoRoot(), "TheFile.txt"); ``` ### IntelliTect.Multitool.Security From 77fd617697c48a9dbf8b26e2c6440c0550a08267 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Wed, 22 Mar 2023 10:57:57 -0700 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e9b347c..b3a37ec 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ### IntelliTect.Multitool -* ReleaseDateAttribute: Gets an UTC DateTime from compile time. +* ReleaseDateAttribute: Gets an UTC DateTime from compile time. Allows us to determine the build date/time. * Example Usage: ```cs