NullableDateHelperFormatDate Method |
Formats a nullable date based on the specified format.
Namespace:
Xcalibur.Helpers
Assembly:
Xcalibur.Helpers (in Xcalibur.Helpers.dll) Version: 1.0.1.0 (1.0.1.0)
Syntax public static string FormatDate(
this Nullable<DateTime> date,
string format,
bool convertToUtc = false
)
<ExtensionAttribute>
Public Shared Function FormatDate (
date As Nullable(Of DateTime),
format As String,
Optional convertToUtc As Boolean = false
) As String
public:
[ExtensionAttribute]
static String^ FormatDate(
Nullable<DateTime> date,
String^ format,
bool convertToUtc = false
)
[<ExtensionAttribute>]
static member FormatDate :
date : Nullable<DateTime> *
format : string *
?convertToUtc : bool
(* Defaults:
let _convertToUtc = defaultArg convertToUtc false
*)
-> string
Parameters
- date
- Type: SystemNullableDateTime
The date. - format
- Type: SystemString
The format. - convertToUtc (Optional)
- Type: SystemBoolean
if set to true [convert to UTC].
Return Value
Type:
StringUsage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
NullableDateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also