[Overview][Constants][Procedures and functions][Index] |
Extract the week of the year (and optionally year) of a TDateTime indication.
Source position: dateutil.inc line 177
function WeekOfTheYear( |
const AValue: TDateTime |
):Word; overload; |
const AValue: TDateTime; |
out AYear: Word |
):Word; overload; |
AValue |
|
Date from which to extract week. |
Week of the year in which Avalue falls.
AValue |
|
Date from which to extract week. |
AYear |
|
Year part of AValue |
WeekOfTheYear extracts the week of the year from Avalue and returns it, and optionally returns the year as well. It returns the same value as WeekOf.
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 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 week (of the year) from a given date. |
|
|
Extract the month of a TDateTime indication. |
|
|
Extracts the day of the year from a TDateTime value |
|
|
Calculate the number of hours passed since the start of the year. |
|
|
Calculate the number of minutes elapsed since the start of the year |
|
|
Calculate the number of seconds elapsed since the start of the year. |
|
|
Calculate the number of milliseconds elapsed since the start of the year. |
Program Example40; { This program demonstrates the WeekOfTheYear function } Uses SysUtils,DateUtils; Var N : TDateTime; Begin N:=Now; Writeln('Month of the year : ',MonthOfTheYear(N)); Writeln('Week of the year : ',WeekOfTheYear(N)); Writeln('Day of the year : ',DayOfTheYear(N)); Writeln('Hour of the year : ',HourOfTheYear(N)); Writeln('Minute of the year : ',MinuteOfTheYear(N)); Writeln('Second of the year : ',SecondOfTheYear(N)); Writeln('MilliSecond of the year : ', MilliSecondOfTheYear(N)); End.