Sign in Join
FPDoc Onlineexperiment

DecodeDateDay procedure

In unit DateUtils

Decode a TDateTime value in year and year of day.

Declaration

pascal
procedure DecodeDateDay(const AValue: TDateTime; out AYear: Word; 
 out ADayOfYear: Word)

Arguments

AValue

TDateTime to decode.

AYear

Returns the year part of AValue.

ADayOfYear

Returns the day-of-year part of AValue.

Description

DecodeDateDay decomposes the date indication in AValue and returns the various components in AYear, ADayOfYear.

See also

Example: ex83

pascal
Program Example83;

{ This program demonstrates the DecodeDateDay function }

Uses SysUtils,DateUtils;

Var
  Y,DoY : Word;
  TS : TDateTime;

Begin
  DecodeDateDay(Now,Y,DoY);
  TS:=EncodeDateDay(Y,DoY);
  Writeln('Today is : ',DateToStr(TS));
End.

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