public static String ToShortDateString(this DateTime dateTime, [NotNull] DateTimeFormatInfo formatInfo) { dateTime.ThrowIfNull(nameof(dateTime)); formatInfo.ThrowIfNull(nameof(formatInfo)); return(dateTime.ToString("d", formatInfo)); }
public static String ToLongDateShortTimeString(this DateTime dateTime, [NotNull] DateTimeFormatInfo formatInfo) { formatInfo.ThrowIfNull(nameof(formatInfo)); return(dateTime.ToString("f", formatInfo)); }
public static String ToYearMonthString(this DateTime dateTime, [NotNull] DateTimeFormatInfo formatInfo) { formatInfo.ThrowIfNull(nameof(formatInfo)); return(dateTime.ToString("y", formatInfo)); }
public static String ToUniversalSortableLongDateTimeString(this DateTime dateTime, [NotNull] DateTimeFormatInfo formatInfo) { formatInfo.ThrowIfNull(nameof(formatInfo)); return(dateTime.ToString("U", formatInfo)); }