Version

MinimumNumberOfValidFields Property

Gets sets minimum number of valid fields in the date string which must be present to consider the date valid.
Syntax
'Declaration
 
Public Property MinimumNumberOfValidFields As Integer
public int MinimumNumberOfValidFields {get; set;}
Remarks

Range of values: 0-7. If this property is set to 0, all fields are validated. Default value is 3.

Missing hour, minute, second, millisecond fields are replaced by 0, and missing year, month, day fields are replaced by the fields of the today date. Date fields are counted from the left to right as they appear in the pattern of date format.

When validating, the day-of-week and AM-PM fields are skipped and not included for the purposes of this property. For example, if the pattern of date format is "M-d-yy H:mm:ss" and the MinimumNumberOfValidFields is 4, then strings are validated as indicated below:

  • "10-20-2 5:20:__" - represents valid date "10-20-02 5:20:00".
  • "10-20-2 5:__:__" - represents valid date "10-20-02 5:00:00".
  • "10-20-2 _:__:__" - represents an invalid date.
  • "10-20-_ 5:20:30" - represents an invalid date.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also