Type | Description | |||
Date as Date | A Date expression being formatted | |||
Format as String | A String expression that indicates the format of date. | |||
String | A String expression that indicates the formatted date. |
The Format parameter may include the following built-in tags:
The following tags are displayed based on the user's Regional and Language Options:
The following VB sample displays the next day as "Tue, May 31, 2005":
With G2antt1.Chart Debug.Print .FormatDate(.NextDate(.FirstVisibleDate, exDay, 2), "<%ddd%>, <%mmmm%> <%d%>, <%yyyy%>") End With
The following C++ sample displays the next day as "Tue, May 31, 2005":
CChart chart = m_g2antt.GetChart(); DATE d = chart.GetNextDate( V2D( &chart.GetFirstVisibleDate() ), 4096, COleVariant( (long)1 ) ); CString strFormat = chart.GetFormatDate( d, "<%ddd%>, <%mmmm%> <%d%>, <%yyyy%>" ); OutputDebugString( strFormat );
where the V2D function converts a Variant expression to a DATE expression:
static DATE V2D( VARIANT* pvtDate ) { COleVariant vtDate; vtDate.ChangeType( VT_DATE, pvtDate ); return V_DATE( &vtDate ); }
The following VB.NET sample displays the next day as "Tue, May 31, 2005":
With AxG2antt1.Chart Debug.Write(.FormatDate(.NextDate(.FirstVisibleDate, EXG2ANTTLib.UnitEnum.exDay, 2), "<%ddd%>, <%mmmm%> <%d%>, <%yyyy%>")) End With
The following C# sample displays the next day as "Tue, May 31, 2005":
DateTime d = Convert.ToDateTime( axG2antt1.Chart.get_NextDate(Convert.ToDateTime(axG2antt1.Chart.FirstVisibleDate), EXG2ANTTLib.UnitEnum.exDay, 1) ); String strFormat = axG2antt1.Chart.get_FormatDate(d, "<%ddd%>, <%mmmm%> <%d%>, <%yyyy%>"); System.Diagnostics.Debug.Write(strFormat);
The following VFP sample displays the next day as "Tue, May 31, 2005":
With thisform.G2antt1.Chart wait window nowait .FormatDate(.NextDate(.FirstVisibleDate, 4096, 2), "<%ddd%>, <%mmmm%> <%d%>, <%yyyy%>") EndWith