DecodeDateMonthWeek

Decode a TDateTime value in a month, week of month and day of week

Declaration

Source position: dateutil.inc line 331

  procedure DecodeDateMonthWeek(const AValue: TDateTime; out AYear: Word; 
                               out AMonth: Word; out AWeekOfMonth: Word; 
                               out ADayOfWeek: Word);

Description

DecodeDateMonthWeek decomposes the date indication in AValue and returns the various components in AYear, AMonthAWeekOfMonth and ADayOfWeek.

See also

Name Description
DecodeDateDay Decode a TDateTime value in year and year of day.
DecodeDateTime Decode a TDateTime value in a date and time value
DecodeDateWeek Decode a TDateTime value in a week of year and day of week.
EncodeDateDay Encodes a year and day of year to a TDateTime value
EncodeDateMonthWeek Encodes a year, month, week of month and day of week to a TDateTime value
EncodeDateTime Encodes a TDateTime value from all its parts
EncodeDateWeek Encode a TDateTime value from a year, week and day of week triplet

Example

Program Example85;
{ This program demonstrates the DecodeDateMonthWeek function }
Uses SysUtils,DateUtils;
Var
  Y,M,Wom,Dow : Word;
  TS : TDateTime;
Begin
  DecodeDateMonthWeek(Now,Y,M,WoM,DoW);
  TS:=EncodeDateMonthWeek(Y,M,WoM,Dow);
  Writeln('Today is : ',DateToStr(TS));
End.