Sign in Join
FPDoc Onlineexperiment

DecodeDateWeek procedure

In unit DateUtils

Decode a TDateTime value in a week of year and day of week.

Declaration

pascal
procedure DecodeDateWeek(const AValue: TDateTime; out AYear: Word; 
 out AWeekOfYear: Word; out ADayOfWeek: Word)

Arguments

AValue

TDateTime to decode.

AYear

Returns the year part of AValue.

AWeekOfYear

Returns the week of year part of AValue.

ADayOfWeek

Returns the day of week part of AValue.

Description

DecodeDateWeek decomposes the date indication in AValue and returns the various components in AYear, AWeekOfYear, ADayOfWeek.

See also

Example: ex81

pascal
Program Example81;

{ This program demonstrates the DecodeDateWeek function }

Uses SysUtils,DateUtils;

Var
  Y,W,Dow : Word;
  TS : TDateTime;

Begin
  DecodeDateWeek(Now,Y,W,Dow);
  TS:=EncodeDateWeek(Y,W,Dow);
  Writeln('Today is : ',DateToStr(TS));
End.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.