FormatDate
Definition
- Namespace
- Resto.Front.PrintTemplates.Cheques.Razor
Formats a numeric date without a time.
string TemplateBaseCore<T>.FormatDate(DateTime date)
- Returns
string- Nullability
- Not specified
- Declared in
- Resto.Front.PrintTemplates.Cheques.Razor.TemplateBaseCore<T>
- Model purpose
- Base class for RazorEngineCore print templates. Model contains the document data of type T. Provides formatting and markup output methods.
Parameters
DateTime date- Date/time value to format; its time zone is not converted.
Return value
A string formatted with the dd.MM.yyyy pattern.
Remarks
Uses CurrentCulture, including its calendar, month names and time separator. DateTime.Kind does not trigger UTC/local conversion. Components not present in the pattern are omitted, not rounded.
Exceptions
System.ArgumentOutOfRangeException- The value cannot be formatted by the current culture's calendar.
Example
// en-GB FormatDate(new DateTime(2026, 9, 19, 14, 35, 42)); // "19.09.2026"