<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    Wochentag zu einem Datum ermitteln %
%    von Andreas Schrell                %
%        Windhoevel 2                   %
%        5600 Wuppertal 2               %
%        Tel. 0202/666889               %
%    E-Mail: ma107 at dhafeu11.bitnet   %
%    Version 1.0 vom 9.10.1991          %
%                                       %
% Aufruf:                               %
% \Wochentag dd.mm.jjjj.                %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

{\catcode`\@=11
\newcount\@tag
\newcount\@monat
\newcount\@jahr
\newcount\@ja
\newcount\@jb
\newcount\@ha
\newcount\@hb
\newcount\@hc
\newcount\@b
\newcount\@f
\gdef\Wochentag #1.#2.#3.{\@tag=#1\@monat=#2\@jahr=#3
\ifnum\@jahr&lt;100\advance\@jahr by 1900\else\fi
\ifnum\@monat&lt;3                         % if monat&lt;3
 \advance\@monat by 10                  %   monat:=monat+10
 \advance\@jahr by -1                   %   jahr:=jahr-1
\else                                   % else
 \advance\@monat by -2                  %   monat:=monat-2
\fi                                     % fi
\@ja=\@jahr\divide\@ja by 100           % ja:=jahr/100
\@jb=-\@ja\multiply\@jb by 100
\advance \@jb by \@jahr                 % jb:=jahr-ja*100
\@ha=\@monat\multiply\@ha by 13         
\advance\@ha by -1                      % ha:=13*monat-1
\divide\@ha by 5                        % ha:=ha/5
\@hb=\@jb\divide\@hb by 4               % hb:=jb/4
\@hc=\@ja\divide\@hc by 4               % hc:=ja/4
\@b=\@ha\advance\@b by \@hb
\advance\@b by \@hc                     % b:=ha+hb+hc
\@f=\@b\advance\@f by \@jb
\advance\@f by \@tag                    % f:=b+jb+tag
\multiply \@ja by 2
\advance\@f by -\@ja                    % f:=f-2*ja
\@ha=\@f
\divide\@ha by 7
\multiply\@ha by 7
\advance\@f by -\@ha                    % f:= f mod 7
\ifcase\@f Sonntag\or Montag\or Dienstag\or Mittwoch\or Donnerstag\or
           Freitag\or Samstag\else ????????\fi}
}

</pre></body></html>