Table of Contents

Method DateTimeToString

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

DateTimeToString(DateTime?)

Converts a nullable DateTime value to its string representation, including both date and time components.

public virtual string DateTimeToString(DateTime? dt)

Parameters

dt DateTime?

The nullable date and time value to convert. If null, the method returns an empty string.

Returns

string

A string that represents the formatted date and time. Returns an empty string if dt is null.

Remarks

The formatting of the date and time components is determined by the DateFormat and TimeFormat properties, respectively. The resulting string combines both formatted values separated by a space.