Dateutils. isvaliddatetimedateutils. isvaliddatedateutils. isvalidtimedateutils. Exceptions. Exceptions. isvaliddatemonthweek // The following process throws an exception: dateutils. Exceptions
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) Procedure formcreate (Sender: tobject ); end; var form1: tform1; implementation {$ R *. DFM} uses dateutils; Procedure tform1.formcreate (Sender: tobject); var B: Boolean; begin B: = isvaliddatetime (2009, 5, 21, 11, 22, 33,999 ); // true B: = isvaliddatetime (2009, 5, 21, 11, 22, 33,999 9); // false B: = isvaliddate (2009, 5, 21 ); // true B: = isvaliddate (2009, 5, 32); // false B: = isvalidtime (11, 22, 33, 0); // true B: = isvalidtime (11, 22, 61, 0); // false B: = isvaliddateday (2009,141); // true B: = isvaliddateday (2009,366); // false B: = isvaliddateweek (2009, 21, 7); // true B: = isvaliddateweek (2009, 21, 8); // false B: = isvaliddatemonthweek (2009, 5, 3, 7); // true B: = isvaliddatemonthweek (2009, 5, 3, 8); // false // showmessage (booltostr (B, true); end.
Dateutils-Function