Dateutils. daysinyear (); dateutils. daysinmonth (); dateutils. daysinayear (); dateutils. Equals (); dateutils. weeksinyear (); dateutils. weeksinayear ();
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 DT: tdatetime; W: word; begin DT: = strtodatetime ('2017-5-20 11:22:33 '); {total days of the year where the specified date is located} W: = daysinyear (DT); // 365 {total days of the month where the specified date is located} W: = daysinmonth (DT ); // 31 {total days of the specified year} W: = daysinayear (2009); // 365 {total days of the specified year and month} W: = daysinamonth (2009, 5 ); // 31 {total weeks of the year where the specified date is located} W: = weeksinyear (DT); // 53 {total weeks of the specified year} W: = weeksinayear (2009 ); // 53end; end.
Dateutils-Function