Converting one of the answers there...

uses
  SysUtils;
const
  StartingYear = 2012;
var
  Year,Month: Byte;
  Date: TDateTime;
begin
  for Year in [0 .. 5] do begin
    for Month in [1 .. 12] do begin
      Date := EncodeDate(Year,Month,13);
      if DayOfWeek(Date) = 5 then begin
        WriteLn(FormatDateTime('YYYY-MM-DD',Date));
      end;
    end;
  end;
end.



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/printing-each-Friday-the-13-using-Pascal-tp5710496p5710497.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to