Spread 8.0 Documentation
TypeDateCentury Property
Support Options
ActiveX Reference > ActiveX Properties > TypeDateCentury Property

Glossary Item Box

TypeDateCentury Property


See Also    DLL    Example

Applies To

fpSpread control

Description

Sets or returns whether to display the year as a four-digit value in a date cell. This property is available at run time only.

Syntax

C++

BOOL CSpreadSheet::GetTypeDateCentury( );
void CSpreadSheet::SetTypeDateCentury(BOOL value);

Visual Basic

[form.]fpSpread.TypeDateCentury[ = boolean%]

Remarks

The default value for the TypeDateCentury property is based on the Windows regional setting. Note that if you change the date format using the TypeDateFormat property, this property setting can change depending on the Windows regional settings. For example, if this property is set to False, and then you change the setting of the TypeDateFormat property, and the Windows regional settings are set to display four-digit year values, if you return the value for this property it will now be True.

If the TypeDateCentury property is set to True, the application displays the year with full century notation. For example, the application displays "1928" instead of "28". If the property is set to True, when the user types the date into the cell, the cell expects the date value to contain a four-digit year value. If the user does not provide a four-digit year value, when the cell leaves edit mode, the EditError event occurs.

Note: If the TypeDateCentury property is set to False and the date value provides a two-digit year value, by default date cells interpret dates earlier than 01/01/60 as century 2000 dates. For example, the date value 12/31/59 would be interpreted as December 31, 2059. You can change how date cells interpret two-digit date values using the TwoDigitYearMax property.

To use the TypeDateCentury property, specify the sheet with which you want to work by setting the Sheet property. Then specify the cell or cells to which to apply the property, as described in Using Column and Row Properties. Once you set the TypeDateCentury property for a cell or cells, any subsequent date cells you create will use the same TypeDateCentury setting unless you reset it for those cells.

The TypeDateCentury property does not have an effect unless the CellType property is set to 0 (Date) for the specified cell or cells.

Spread Designer

Choose the Cell menu, the Cell Type menu, the Date menu, and then the Settings tab, and then select the Display Century check box in the Cell Type Settings dialog box.

Data Type

Integer (Boolean)

See Also

Formatting a Date Cell

CellType, Sheet, TwoDigitYearMax, TypeDateFormat, TypeDateSeparator properties

EditError event

DLL Correspondence

SSSetTypeDate function

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.