[Overview][Constants][Procedures and functions][Index] |
Extract the week of the month (and optionally month and year) from a TDateTime value
Source position: dateutil.inc line 202
function WeekOfTheMonth( |
const AValue: TDateTime |
):Word; overload; |
const AValue: TDateTime; |
out AYear: Word; |
out AMonth: Word |
):Word; overload; |
AValue |
|
TDateTime value of which to calculate the week, month and year. |
Week of the month
AValue |
|
TDateTime value of which to calculate the week, month and year. |
AYear |
|
Year part of AValue |
AMonth |
|
Month part of AValue |
WeekOfTheMonth extracts the week of the month from Avalue and returns it, and optionally returns the year and month as well (in AYear, AMonth respectively).
Remark: | Note that weeks are numbered from 1 using the ISO 8601 standard, and the day of the week as well. This means that the year and month may not be the same as the year part of the date, since the week may start in the previous year as the first week of the year is the week with at least 4 days in it. |
|
Extract the week of the year (and optionally year) of a TDateTime indication. |
|
|
Extract the day (of month) part of a TDateTime value |
|
|
Calculate the number of hours passed since the start of the month. |
|
|
Calculate number of minutes elapsed since the start of the month. |
|
|
Calculate number of seconds elapsed since the start of the month. |
|
|
Calculate number of milliseconds elapsed since the start of the month. |
Program Example41; { This program demonstrates the WeekOfTheMonth function } Uses SysUtils,DateUtils; Var N : TDateTime; Begin N:=Now; Writeln('Week of the Month : ',WeekOfTheMonth(N)); Writeln('Day of the Month : ',DayOfTheMonth(N)); Writeln('Hour of the Month : ',HourOfTheMonth(N)); Writeln('Minute of the Month : ',MinuteOfTheMonth(N)); Writeln('Second of the Month : ',SecondOfTheMonth(N)); Writeln('MilliSecond of the Month : ', MilliSecondOfTheMonth(N)); End.