FormatLongDateTime
Definition
- Namespace
- Resto.Front.PrintTemplates.Cheques.Razor
Formats a date and time with a numeric date and minute precision.
string TemplateBase<T>.FormatLongDateTime(DateTime dateTime)
- Returns
string- Nullability
- Not specified
- Declared in
- Resto.Front.PrintTemplates.Cheques.Razor.TemplateBase<T>
- Model purpose
- Base class for Legacy Razor print templates. Model contains the document data of type T. Provides formatting and markup output methods.
Parameters
DateTime dateTime- Date/time value to format; its time zone is not converted.
Return value
A string formatted with the dd.MM.yyyy HH:mm 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 FormatLongDateTime(new DateTime(2026, 9, 19, 14, 35, 42)); // "19.09.2026 14:35"