Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,35 @@

### 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
// 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:

```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
Expand Down