DateTimeToStringWithSuffix 1.0.1

Install-Package DateTimeToStringWithSuffix -Version 1.0.1
dotnet add package DateTimeToStringWithSuffix --version 1.0.1
<PackageReference Include="DateTimeToStringWithSuffix" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DateTimeToStringWithSuffix --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DateTimeToStringWithSuffix, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install DateTimeToStringWithSuffix as a Cake Addin
#addin nuget:?package=DateTimeToStringWithSuffix&version=1.0.1

// Install DateTimeToStringWithSuffix as a Cake Tool
#tool nuget:?package=DateTimeToStringWithSuffix&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Supports:

  • .NET Core 1.0 and higher
  • .NET Framework 4.5 and higher

Example usage

https://dotnetfiddle.net/zXQX7y

using System;
using DateTimeToStringWithSuffix;

public class Program
{
  public static void Main()
  {
    Console.WriteLine(DateTime.UtcNow.ToString("d MMM"));  // 1 May
    Console.WriteLine(DateTime.UtcNow.ToStringWithSuffix("d MMM"));  // 1st May
    // Console.WriteLine(DateTime.UtcNow.ToStringWithSuffix("MMM")); // ArgumentException - missing "d" or "dd"
  }
}

Throws an ArgumentException if the format param does not contain a d or dd for the date.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 4,805 5/1/2019