[Overview][Constants][Procedures and functions] | Reference for unit 'dateutils' (#rtl) |
Extract the week of the month (and optionally month and year) from a DateTime value
Source position: line 0
function WeekOfTheMonth( |
const AValue: TDateTime |
):Word; overload; |
const AValue: TDateTime; |
var AYear: Word; |
var AMonth: Word |
):Word; overload; |
AValue |
|
Datetime value of which to calculate the week, month and year. |
Week of the month
AValue |
|
Datetime value of which to calculate the week, month and year. |
AYear |
|
Year part of AValue |
AMonth |
|
Month part of AValue |
Week of the month
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 DateTime indication. |
|
|
Extract the day (of month) part of a DateTime 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.
No notes exist for this page yet.