f0f1f2.studio Template reference
English
Open application
Method

FormatTime

Definition

Namespace
Resto.Front.PrintTemplates.Cheques.Razor

Formats a time with hours and minutes.

string TemplateBase<T>.FormatTime(DateTime time)
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 time
Date/time value to format; its time zone is not converted.

Return value

A string formatted with the 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.

Example

// en-GB
FormatTime(new DateTime(2026, 9, 19, 14, 35, 42)); // "14:35"