Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

FormatDateV Method, SftMaskCalendar Object

Converts a date into a displayable string.

Syntax

VB.NETobject.FormatDateV(ByVal Dt As Date, ByRef Text As Object)
VBobject.FormatDateV(ByVal Dt As Date, Text As Variant)
C#.NETvoid object.FormatDateV(System.DateTime Dt, ref object Text);
VC++HRESULT object->FormatDateV(DATE Dt, const _variant_t&* Text);
CHRESULT object->raw_FormatDateV(DATE Dt, VARIANT* Text);

object

A SftMaskCalendar object.

Dt

The date to be converted to a formatted string.

Text

The caller provides a formatting string or a predefined formatting string, based on which the Date Dt is formatted. If an empty string is used, the short date format is used. The formatted string is returned in Text.

TextDescription
"short"The short date format is used (as defined by the user locale).
"long"The long date format is used (as defined by the user locale).
formatting stringThe formatting string (as supported by GetDateFormat) is used to format the specified date. See below for valid formatting strings.

Comments

The FormatDateV method converts a date into a displayable string.

The FormatDateV method uses the Windows GetDateFormat API to format the specified date Dt.

Text can be defined as "short", "long" or as a formatting string as supported by the Windows GetDateFormat API. A formatting string can consist of one or more of the following items:

TextDescription
dDay of month (without leading zero for single-digit days)
ddDay of month (with leading zero for single-digit days)
dddDay of week as a three-letter abbreviation (using GetLocaleInfo, LOCALE_SABBREVDAYNAME)
ddddDay of week as its full name (using GetLocaleInfo, LOCALE_SDAYNAME)
MMonth (digits without leading zero for single-digit months)
MMMonth (digits with leading zero for single-digit months)
MMMMonth as a three-letter abbreviation (using GetLocaleInfo, LOCALE_SABBREVMONTHNAME)
MMMMMonth as its full name (using GetLocaleInfo, LOCALE_SMONTHNAME)
yYear as last two digits (without leading)
yyYear as last two digits (with leading zero)
yyyyYear represented by full four digits.
ggPeriod/era string (using GetLocaleInfo, CAL_SERASTRING). This is ignored if the date to be formatted does not have an associated era or period string.

Literal characters must be enclosed by single quotes:

Text = "dddd, MMMM d 'in the year' yyyy"

To specify a literal single quote, use two quotes:

Text = "dddd, MMMM d 'in '''yy"

FormatDateV is used for languages such as VBScript, which are limited by requiring Variant arguments and do not support strongly typed arguments for return values. For more information please see Using SftMask/OCX with Internet Explorer.

See Also SftMaskCalendar Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.