%%
%% This is file `eukdate.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% eukdate.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright Andrew Gilbert Moschou 2008
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% 
%%   http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{eukdate}[2009/03/18 v1.04 UK format date (Hart's Rules) with weekday]
\newif\if@euk@noweekday
\newif\if@euk@usdate
\newif\if@euk@julian
\DeclareOption{no-weekday}{\@euk@noweekdaytrue}
\DeclareOption{ukdate}{\@euk@usdatefalse}
\DeclareOption{usdate}{\@euk@usdatetrue}
\DeclareOption{gregorian}{\@euk@julianfalse}
\DeclareOption{julian}{\@euk@juliantrue}
\ExecuteOptions{ukdate,gregorian}
\ProcessOptions\relax
\newcounter{euk@date}
\newcounter{euk@month}
\newcounter{euk@century}
\newcounter{euk@year}
\setcounter{euk@date}{\number\day}
\setcounter{euk@month}{\number\month}
\setcounter{euk@century}{\number\year}
\divide\c@euk@century by 100
\setcounter{euk@year}{\number\year}
\addtocounter{euk@year}{-\theeuk@century00}
\ifnum\number\theeuk@month<3
  \addtocounter{euk@month}{13}
  \addtocounter{euk@year}{-1}
\else
  \addtocounter{euk@month}{1}
\fi
\multiply\c@euk@month by 26
\divide\c@euk@month by 10
\addtocounter{euk@date}{\theeuk@month}
\addtocounter{euk@date}{\theeuk@year}
\divide\c@euk@year by 4
\addtocounter{euk@date}{\theeuk@year}
\if@euk@julian
  \addtocounter{euk@date}{6\theeuk@century}
  \addtocounter{euk@date}{5}
\else
  \addtocounter{euk@date}{5\theeuk@century}
  \divide\c@euk@century by 4
  \addtocounter{euk@date}{\theeuk@century}
\fi
\loop\ifnum6<\theeuk@date
  \addtocounter{euk@date}{-7}
\repeat
\newcommand\weekday{%
  \ifcase\theeuk@date Saturday\or Sunday\or Monday\or
    Tuesday\or Wednesday\or Thursday\or Friday\fi}
\newcommand\monthname{%
  \ifcase\number\month\or January\or February\or March\or
    April\or May\or June\or July\or August\or
    September\or October\or November\or December\fi}
\def\today{%
  \if@euk@noweekday\else\weekday,\space\fi
  \if@euk@usdate
    \monthname\space\number\day,%
  \else
    \number\day\space\monthname
  \fi
  \space\number\year}
\edef\euk@ordinal{%
   \ifcase\number\day\or st\or nd\or rd\or th\or th\or
     th\or th\or th\or th\or th\or th\or th\or th\or th\or
     th\or th\or th\or th\or th\or th\or st\or nd\or rd\or
     th\or th\or th\or th\or th\or th\or th\or st\fi}
\endinput
%%
%% End of file `eukdate.sty'.
