Their parameters are all tdatetime,
Dateof and timeof extract the date and time respectively, and return the tdatetime type;
Yearof, monthof, weekof, dayof, hourof, minuteof, secondof, and millisecondof all return word types.
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs; Type tform1 = Class (tform) Procedure formcreate (Sender: tobject); end; vaR form1: tform1; implementation {$ R *. DFM} uses dateutils; Procedure tform1.formcreate (Sender: tobject); var DT, D, T: tdatetime; year, month, week, day, hour, minute, second, millisecond: word; begin DT: = strtodatetime ('2017-5-20 11:22:33 '); D: = dateof (DT); showmessage (datetostr (d); // 2009-5-20 t: = timeof (DT); showmessage (timetostr (t); // 11:22:33 year: = yearof (DT); month: = monthof (DT); week: = weekof (DT); Day: = dayof (DT); hour: = hourof (DT); minute: = minuteof (DT); Second: = secondof (DT); millisecond: = millisecondof (DT); showmessagefmt ('% d, % d', [year, month, week, day, hour, minute, second, millisecond]); {2009, 5, 20, 11, 0} end; end.
Dateutils-Function