%\iffalse
%<*package>
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%</package>
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
% Copyright (C) 2015 Nicola Talbot, all rights reserved.
% \fi
% \iffalse
%<*driver>
\documentclass{ltxdoc}

\usepackage{alltt}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[colorlinks,
            bookmarks,
            hyperindex=false,
            pdfauthor={Nicola L.C. Talbot},
            pdftitle={datetime2.sty English Module}]{hyperref}


\CheckSum{2270}

\renewcommand*{\usage}[1]{\hyperpage{#1}}
\renewcommand*{\main}[1]{\hyperpage{#1}}
\IndexPrologue{\section*{\indexname}\markboth{\indexname}{\indexname}}
\setcounter{IndexColumns}{2}

\newcommand*{\sty}[1]{\textsf{#1}}
\newcommand*{\opt}[1]{\texttt{#1}\index{#1=\texttt{#1}|main}}

\RecordChanges
\PageIndex
\CodelineNumbered

\begin{document}
\DocInput{datetime2-english.dtx}
\end{document}
%</driver>
%\fi
%
%\MakeShortVerb{"}
%
%\title{English Module for datetime2 Package}
%\author{Nicola L. C. Talbot}
%\date{2015-03-24 (v1.0)}
%\maketitle
%
%\begin{abstract}
%This is the English language module for the \sty{datetime2}
%package. If you want to use the settings in this module you must
%install it in addition to installing \sty{datetime2}. If you use
%\sty{babel} or \sty{polyglossia}, you will need this module to
%prevent them from redefining \cs{today}. The \sty{datetime2}
% \opt{useregional} setting must be on (\texttt{text} or
% \texttt{numeric}) for the language styles to be set.
% Alternatively, you can set them in the document using
% \cs{DTMsetstyle}, but without the \opt{useregional} setting on the
% style will be changed by \cs{date}\meta{language}.
%\end{abstract}
%
%\tableofcontents
%\clearpage
%
%\section{Introduction}
%\label{sec:intro}
% This bundle provides the English modules for \sty{datetime2}.
% The basic "english" module is used when "english" has been 
% detected as one of the document's language settings but no
% regional variant has been detected. Note that the \sty{tracklang} 
% package can't detect the variant passed to \sty{polyglossia} unless it's been
% passed as a document class option or passed to \sty{tracklang}.
% See the \sty{tracklang} documentation for further details.
%
% Here are some example usage for British English with
% \sty{polyglossia}:
%
%\begin{enumerate}
%\item Pass "british" in the document class option list:
%\begin{verbatim}
%\documentclass[british]{article}
%
%\usepackage{fontspec}
%\usepackage{polyglossia}
%\usepackage{datetime2}
%\end{verbatim}
%(You need to set the \opt{useregional} option to either
%\texttt{text} or \texttt{numeric} to enable the "en-GB" or
%"en-GB-numeric" styles.)
%
%\item Pass "en-GB" in the document class option list and use
% \sty{polyglossia}'s language interface:
%\begin{verbatim}
%\documentclass[en-GB]{article}
%
%\usepackage{fontspec}
%\usepackage{polyglossia}
%\setdefaultlanguage[variant=uk]{english}
%
%\usepackage{datetime2}
%\end{verbatim}
%(You need to set the \opt{useregional} option to either
%\texttt{text} or \texttt{numeric} to enable the "en-GB" or
%"en-GB-numeric" styles.)
%
%\item Pass "en-GB" to \sty{datetime2}:
%\begin{verbatim}
%\documentclass{article}
%
%\usepackage{fontspec}
%\usepackage{polyglossia}
%\setdefaultlanguage[variant=uk]{english}
%
%\usepackage[en-GB]{datetime2}
%\end{verbatim}
% In this last example, the style is automatically switched to
% "en-GB".
%\end{enumerate}
%
%Note that if you pass the language setting through the
%\sty{datetime2} package option list (as in the above example)
%this will also set the \opt{useregional} option to \texttt{text}.
%
%If you're not using \sty{babel} or \sty{polyglossia} but still
% want to use the English modules, you can similarly use the language or
% regional setting in the document class or \sty{datetime2} package
% options. Note that since \sty{datetime2} loads \sty{tracklang},
% this setting will be remembered by any subsequently loaded
% packages that use \sty{tracklang} to determine the document
% language settings.
%
% For example, to use the "en-GB" date style without loading
% \sty{babel} or \sty{polyglossia}:
%\begin{verbatim}
%\documentclass{article}
%\usepackage[en-GB]{datetime2}
%\begin{document}
%\today
%\end{document}
%\end{verbatim}
%
%\section{Base module}
%\label{sec:base}
%The "english-base" module is loaded by all the English modules. It
%provides the commands that produce text, such as the month names.
%It also provides a 12 hour time style called \texttt{englishampm}.
%
%\section{English (no region)}
%\label{sec:english}
% The default "english" module is used when English has been set as
% one of the document languages, but no regional variant has been
% detected or there is no support for the given region.
%
% This basic module provides the date-time style "english" which
% uses the same style as \LaTeX's default \cs{today}. (That is, the
% middle-endian date style.) This style ignores most of the settings, including
% \opt{showdow} and the date separators. The time style uses the
% "englishampm" style defined in the base module which uses the
% package-wide \opt{hourminsep} setting. The zone style is the
% same as that provided by the "default" style. (That is, numerical
% ISO or just ``Z''.) The full date, time and zone style (used by \cs{DTMdisplay})
% have spaces between each block. The \opt{showdate}, \opt{showzone}, \opt{showseconds},
% \opt{showzoneminutes} and \opt{showisoZ} \sty{datetime2} settings are honoured.
%
%This module checks for the existence of \cs{dateenglish} or
%\cs{date}\meta{dialect} (in the case of an unknown English
%variant that doesn't match any of the supplied English dialect modules).
%If it exists, the command will be redefined so that it
%sets the date, time and zone styles to "english" if the
%\opt{useregional} setting is set to \texttt{text}. If the setting
%is \texttt{numeric} the "default" numeric style will be used as the
%lack of region makes it ambiguous.
%
%\section{English (GB)}
%\label{sec:en-GB}
%
%The "en-GB" module is loaded if British English has been specified.
%This may be specified through options such as "british", "en-GB" or
%"UKenglish". (See the note on \sty{polyglossia} in \S\ref{sec:intro}.)
%
% This module defines the text style "en-GB" and the
% numeric style "en-GB-numeric" style. The "en-GB" style will
% automatically be set if the \opt{useregional} option is
% set to \texttt{text}. The "en-GB-numeric" style will automatically
% be set if the \opt{useregional} option is set to \texttt{numeric}.
%
% The "en-GB" time style uses the base "englishampm" style.
%
% There are a number of settings provided that can be used in
% \cs{DTMlangsetup} to modify the date style. These are:
%
%\begin{description}
%\item[\opt{daymonthsep}] The separator between the day and the month
%name in the \texttt{en-GB} style. This defaults to \cs{space}.
%
%\item[\opt{monthyearsep}] The separator between the month name and year
% in the \texttt{en-GB} style. This defaults to \cs{space}.
%
%\item[\opt{datesep}] The separator between the date numbers in the
%"en-GB-numeric" style. This defaults to "/" (slash).
%
%\item[\opt{timesep}] The separator between the hours and minutes in the
%"en-GB-numeric" style. This defaults to ":" (colon).
%
%\item[\opt{datetimesep}] The separator between the date and time for the
%full date-time format (as used by \cs{DTMdisplay}) for both the
%"en-GB" and "en-GB-numeric" styles. This defaults
%to \cs{space}.
%
%\item[\opt{timezonesep}] The separator between the time and zone for the
%full date-time format (as used by \cs{DTMdisplay}) for both the 
%"en-GB" and "en-GB-numeric" styles. This defaults
%to \cs{space}.
%
%\item[\opt{abbr}] This is a~boolean key. If "true", the month (and week
%day name if shown) is abbreviated for the "en-GB" style. The default is "false".
%
%\item[\opt{mapzone}] This is a~boolean key. If "true" the time zone
%mappings are applied. (The default is \texttt{true}.) The "en-GB"
% and "en-GB-numeric" styles set the mappings GMT
%(UTC+00:00) and BST (UTC+01:00).
%Other time zone mappings that have previously been set 
%(for example, by another regional style) will remain unchanged 
%unless you redefine \cs{DTMresetzones} to reset or unset them.
%
%\item[\opt{ord}] This may take one of the following values: "level"
%(ordinal suffix level with the number), "raise" (ordinal suffix as
%a superscript\footnote{Just in case you plan to send me an irate
%email on this issue, the superscript is a regional handwriting
%style not an invention of word processors although they have
%adopted the style. I was using this style in school in the 1970s
%before I'd ever heard of a word processor so please don't tell me
%I've picked up the habit from Word. I'm not a time-traveller, nor
%were my primary school teachers\,---\,that I know of! If, conversely,
%you want to know why the default is \texttt{level} rather than
%\texttt{raise}, it's because the main purpose of the
%\sty{datetime2} package is to provide an \emph{expandable} text
%format and \cs{textsuperscript} isn't expandable.}),
% "omit" (omit the ordinal suffix) and "sc" (small
%caps ordinal suffix). If you want a different style you can
%redefine \cs{DTMenGBfmtordsuffix} which takes one argument (the
%suffix). Take care if \cs{DTMenGBfmtordsuffix} contains fragile
%commands, as they will need to be protected against expansion.
%
%\item[\opt{showdayofmonth}] A boolean key that determines whether
%or not to show the day of the month. The default value is "true".
%If "false" the day-month separator is also omitted.
%
%\item[\opt{showyear}] A boolean key that determines whether
%or not to show the year. The default value is "true". If "false"
%the month-year separator is also omitted.
%\end{description}
%
%The above settings are specific to this module. In addition, the
%\opt{showdow} boolean option provided by the \sty{datetime2} package is
%also checked to determine whether or not to show the day of the
%week in the "en-GB" style. 
%
%The time zone checks the \opt{mapzone}
%setting (described above). If it's set, then
%\cs{DTMusezonemapordefault} is used otherwise a numeric
%\meta{TZH}\meta{sep}\meta{TZM} is displayed. (The minute part will be
%omitted if the \sty{datetime2} package option \opt{showzoneminutes} is
%set to "false". The zone style ignores the \opt{showisoZ} option.
%
%
%\section{English (US)}
%\label{sec:en-US}
%
%The "en-US" module is loaded if US English has been specified. This
%may be done through options such as "american", "en-US" or
%"USenglish". (See the note on \sty{polyglossia} in \S\ref{sec:intro}.)
%
%This module defines the styles "en-US" and
%"en-US-numeric". There a number of settings that can be used in 
% \cs{DTMlangsetup} to modify these styles. They are:
%\begin{description}
%\item[\opt{monthdaysep}] The separator between the month name and
%the day in the "en-US" style. The default is \cs{space}
%
%\item[\opt{dayyearsep}] The separator between the day and the year
%in the "en-US" style.  The default is ",\space"
%
%\item[\opt{datesep}] The separator between the date numbers in the
%"en-US-numeric" format.
%
%\item[\opt{timesep}] The separator between the hour and minutes in the
%"en-US-numeric" format.
%
%\item[\opt{datetimesep}] The separator between the date and the
%time for the full style used by \cs{DTMdisplay} for the "en-US"
%and "en-US-numeric". The default is \cs{space}
%
%\item[\opt{timezonesep}] The separator between the times and 
%zone for the full style used by \cs{DTMdisplay}. The default is
%\cs{space}
%
%\item[\opt{abbr}] This is a~boolean key. If "true", the month 
%is abbreviated. The default is "false".
%
%\item[\opt{mapzone}] This is a~boolean key. If "true" the time zone
%mappings are applied. (The default is \texttt{false}.) The "en-US" style sets the mappings ADT
%(UTC$-$03:00), AST (UTC$-$04:00), EST (UTC$-$05:00), CST
%(UTC$-$06:00),
%MST (UTC$-$07:00) and PST (UTC$-$08:00). If your want to use different
%mappings, you can redefine \cs{DTMuszonemaps}.
%Other time zone mappings that have previously been set 
%(for example, by another regional style) will remain unchanged 
%unless you redefine \cs{DTMresetzones} to reset or unset them.
%
%\item[\opt{ord}] The same as the "en-GB" style except that the default
%value is "omit".
%
%\item[\opt{showdayofmonth}] A boolean key that determines whether
%or not to show the day of the month. The default value is "true".
%If "false" the day-year separator is also omitted.
%
%\item[\opt{showyear}] A boolean key that determines whether
%or not to show the year. The default value is "true". If "false"
%the day-year separator is also omitted if the day of the month is
%shown otherwise both the day-year and month-day separators are omitted.
%
%\end{description}
%
%The "en-US" style doesn't use the \opt{showdow} setting.
%
%The "en-US" time style uses the "englishampm". The "en-US-numeric"
%uses a 24 hour style. The time zone checks the \opt{mapzone}
%setting (described above). If it's set, then
%\cs{DTMusezonemapordefault} is used otherwise a numeric
%\meta{TZH}:\meta{TZM} is displayed. (The minute part will be
%omitted if the \sty{datetime2} package option \opt{showzoneminutes} is
%set to "false". The zone style ignores the \opt{showisoZ} option.
%
%\section{English (CA)}
%\label{sec:en-CA}
%
%The "en-CA" module is loaded if Canadian English has been specified. This
%may be done through options such as "en-CA" or
%"canadian". (See the note on \sty{polyglossia} in \S\ref{sec:intro}.)
%
% This module provides the "en-CA" and "en-CA-numeric" styles
% that are virtually identical to the "en-US" and "en-US-numeric" style.
% These have the same options as for the US styles but the zone maps
% are provided by\cs{DTMenCAzonemaps}, which can be redefined as required.
% This has the additional time zones NDT and NST. Note that other than NDT,
%daylight saving isn't taken into account.
%
%\section{English (AU)}
%\label{sec:en-AU}
%
%The "en-AU" module is loaded if Australian English has been specified. This
%may be done through options such as "en-AU" or
%"australian". (See the note on \sty{polyglossia} in \S\ref{sec:intro}.)
%
% This module provides the "en-AU" and "en-AU-numeric" styles that
% are virtually identical to the "en-GB" and "en-GB-numeric" styles.
% These have the same options as the GB styles (except that the default value of
% \opt{ord} is "omit" rather than "level" and the default value of
% "mapzone" is false) but the zone maps are provided by
%\cs{DTMenAUzonemaps}, which can be redefined as required. Note that
%daylight saving isn't taken into account.
%
%\section{English (NZ)}
%\label{sec:en-NZ}
%
%The "en-NZ" module is loaded if New Zealand English has been specified. This
%may be done through options such as "en-NZ" or
%"newzealand". (See the note on \sty{polyglossia} in \S\ref{sec:intro}.)
%
% This module provides the "en-NZ" and "en-NZ-numeric" styles that
% are virtually identical to the "AU" styles but the zone maps are provided by
%\cs{DTMenNZzonemaps}, which can be redefined as required.
%
%\section{English (GG)}
%\label{sec:en-GG}
%
% The Guernsey English "en-GG" and "en-GG-numeric" styles are like the 
% British English "en-GB" and "en-GB-numeric" styles, but replace \texttt{enGB}
% with \texttt{enGG} in the command names. This style can be loaded
% by using \texttt{en-GG} as a document class option or as a
% package option for either \sty{tracklang} or \sty{datetime2}.
%
%\section{English (JE)}
%\label{sec:en-JE}
% The Jersey English "en-JE" and "en-JE-numeric" styles are like the 
% British English "en-GB" and "en-GB-numeric" styles, but replace \texttt{enGB}
% with \texttt{enJE} in the command names. This style can be loaded
% by using \texttt{en-JE} as a document class option or as a
% package option for either \sty{tracklang} or \sty{datetime2}.
%
%\section{English (IM)}
%\label{sec:en-IM}
% The Isle of Man "en-IM" and "en-IM-numeric" styles are like the 
% British English "en-GB" and "en-GB-numeric" styles, but replace \texttt{enGB}
% with \texttt{enIM} in the command names. This style can be loaded
% by using \texttt{en-IM} as a document class option or as a
% package option for either \sty{tracklang} or \sty{datetime2}.
%
%\section{English (MT)}
%\label{sec:en-MT}
% The Malta English "en-MT" and "en-MT-numeric" styles are like the 
% British English "en-GB" and "en-GB-numeric" styles, but replace \texttt{enGB}
% with \texttt{enMT} in the command names. This style can be loaded
% by using \texttt{en-MT} as a document class option or as a
% package option for either \sty{tracklang} or \sty{datetime2}.
%
% There are two main differences in the
% \texttt{en-GB}\slash\texttt{en-GB-numeric} and
% \texttt{en-MT}\slash\texttt{en-MT-numeric} styles: the \opt{ord} option
% (for the text styles) defaults to
% \texttt{omit} and the CET (+01:00) and CEST (+02:00) time zone
% mappings are added (for both the text and numeric styles).
%
%\section{English (IE)}
%\label{sec:en-IE}
% The Republic of Ireland English "en-IE" and "en-IE-numeric" styles are like the 
% British English "en-GB" and "en-GB-numeric" styles, but replace \texttt{enGB}
% with \texttt{enIE} in the command names. This style can be loaded
% by using \texttt{en-IE} as a document class option or as a
% package option for either \sty{tracklang} or \sty{datetime2}.
% You will need at least version 1.2 of the \sty{tracklang} package
% installed.
%
% The only difference in the
% \texttt{en-GB}\slash\texttt{en-GB-numeric} and
% \texttt{en-IE}\slash\texttt{en-IE-numeric} styles is that
% the +01:00 time zone is mapped to IST instead of
% BST. If you prefer WET/WEST time zones, you can do:
%\begin{verbatim}
%\renewcommand*{\DTMenIEzonemaps}{%
%  \DTMdefzonemap{00}{00}{WET}%
%  \DTMdefzonemap{01}{00}{WEST}%
%}
%\end{verbatim}
%
%For Irish Gaelic you need the "irish" module instead.
%
%\StopEventually{%
%\clearpage
%\phantomsection
%\addcontentsline{toc}{section}{Change History}%
%\PrintChanges
%\addcontentsline{toc}{section}{\indexname}%
%\PrintIndex}
%\section{The Code}
%\iffalse
%    \begin{macrocode}
%<*datetime2-english-base.ldf>
%    \end{macrocode}
%\fi
%\subsection{Base Code (\texttt{datetime2-english-base.ldf})}
%This file contains the code common to all the English regional
%variations.
%\changes{1.0}{2015-03-24}{Initial release}
% Identify module
%    \begin{macrocode}
\ProvidesDateTimeModule{english-base}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Since the main emphasize of the \sty{datetime2} package is to
% provide expandable dates where possible, the commands here need to
% be expandable. (Anything that wasn't expandable would need to be
% protected.) Therefore the default ordinal format is a simple
% expandable format (which is why \sty{fmtcount} isn't being used).
%\begin{macro}{\DTMenglishordinal}
%    \begin{macrocode}
\newcommand*{\DTMenglishordinal}[1]{%
  \number#1 % space intended
  \DTMenglishfmtordsuffix{%
    \ifcase#1
    \or \DTMenglishst 
    \or \DTMenglishnd 
    \or \DTMenglishrd 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishst 
    \or \DTMenglishnd 
    \or \DTMenglishrd 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishth 
    \or \DTMenglishst 
    \fi
  }%
}
%    \end{macrocode}
%\end{macro}
%
%Just in case a~user has some need to change the ordinal suffixes,
%these are provided as commands.
%\begin{macro}{\DTMenglishst}
%    \begin{macrocode}
\newcommand*{\DTMenglishst}{st}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DTMenglishnd}
%    \begin{macrocode}
\newcommand*{\DTMenglishnd}{nd}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DTMenglishrd}
%    \begin{macrocode}
\newcommand*{\DTMenglishrd}{rd}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\DTMenglishth}
%    \begin{macrocode}
\newcommand*{\DTMenglishth}{th}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenglishfmtordsuffix}
%The suffix can have a format applied to it (for example, made a
%superscript or converted to small caps). The default ignores
%the argument, which makes it consistent with \TeX's default date
%format. This can be changed by regional modules.
%    \begin{macrocode}
\newcommand*{\DTMenglishfmtordsuffix}[1]{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenglishmonthname}
% English month names.
%    \begin{macrocode}
\newcommand*{\DTMenglishmonthname}[1]{%
  \ifcase#1
  \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
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenglishshortmonthname}
% Abbreviated English month names.
%    \begin{macrocode}
\newcommand*{\DTMenglishshortmonthname}[1]{%
  \ifcase#1
  \or
  Jan%
  \or
  Feb%
  \or
  Mar%
  \or
  Apr%
  \or
  May%
  \or
  Jun%
  \or
  Jul%
  \or
  Aug%
  \or
  Sep%
  \or
  Oct%
  \or
  Nov%
  \or
  Dec%
  \fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenglishweekdayname}
% English day of week names.
%    \begin{macrocode}
\newcommand*{\DTMenglishweekdayname}[1]{%
  \ifcase#1
  Monday%
  \or
  Tuesday%
  \or
  Wednesday%
  \or
  Thursday%
  \or
  Friday%
  \or
  Saturday%
  \or
  Sunday%
  \fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenglishweekdayname}
% English abbreviated day of week names.
%    \begin{macrocode}
\newcommand*{\DTMenglishshortweekdayname}[1]{%
  \ifcase#1
  Mon%
  \or
  Tue%
  \or
  Wed%
  \or
  Thu%
  \or
  Fri%
  \or
  Sat%
  \or
  Sun%
  \fi
}
%    \end{macrocode}
%\end{macro}
%
% 12 hour time tags.
%\begin{macro}{\DTMenglisham}
%    \begin{macrocode}
\newcommand*\DTMenglisham{am}%
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenglishpm}
%    \begin{macrocode}
\newcommand*\DTMenglishpm{pm}%
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenglishmidnight}
%    \begin{macrocode}
\newcommand*\DTMenglishmidnight{midnight}%
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenglishnoon}
%    \begin{macrocode}
\newcommand*\DTMenglishnoon{noon}%
%    \end{macrocode}
%\end{macro}
%
% am/pm time style.
%\begin{macro}{\DTMenglishampmfmt}
%    \begin{macrocode}
\newcommand*{\DTMenglishampmfmt}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenglishtimesep}
%    \begin{macrocode}
\newcommand*{\DTMenglishtimesep}{\DTMsep{hourmin}}
%    \end{macrocode}
%\end{macro}
%
% This style ignores seconds.
%    \begin{macrocode}
\DTMnewtimestyle
 {englishampm}% label
 {% 
    \renewcommand*\DTMdisplaytime[3]{%
      \ifnum##2=0
        \ifnum##1=12
          \DTMtexorpdfstring
            {\DTMenglishampmfmt{\DTMenglishnoon}}%
            {\DTMenglishnoon}%
        \else
          \ifnum##1=0
            \DTMtexorpdfstring
            {\DTMenglishampmfmt{\DTMenglishmidnight}}%
            {\DTMenglishmidnight}%
          \else
            \ifnum##1=24
              \DTMtexorpdfstring
              {\DTMenglishampmfmt{\DTMenglishmidnight}}%
              {\DTMenglishmidnight}%
            \else
              \ifnum##1<12
                \number##1
                \DTMtexorpdfstring
                {\DTMenglishampmfmt{\DTMenglisham}}%
                {\DTMenglisham}%
              \else
                \number\numexpr##1-12\relax
                \DTMtexorpdfstring
                {\DTMenglishampmfmt{\DTMenglishpm}}%
                {\DTMenglishpm}%
              \fi
            \fi
          \fi
        \fi
      \else
        \ifnum##1<13
          \ifnum##1=0
            12%
          \else
            \number##1
          \fi
          \DTMenglishtimesep\DTMtwodigits{##2}%
          \ifnum##1=12
            \DTMtexorpdfstring
            {\DTMenglishampmfmt{\DTMenglisham}}%
            {\DTMenglishpm}%
          \else
            \DTMtexorpdfstring
            {\DTMenglishampmfmt{\DTMenglisham}}%
            {\DTMenglisham}%
          \fi
        \else
          \number\numexpr##1-12\relax
          \DTMenglishtimesep\DTMtwodigits{##2}%
          \ifnum##1=24
            \DTMtexorpdfstring
            {\DTMenglishampmfmt{\DTMenglishpm}}%
            {\DTMenglisham}%
          \else
            \DTMtexorpdfstring
            {\DTMenglishampmfmt{\DTMenglishpm}}%
            {\DTMenglishpm}%
          \fi
        \fi
      \fi
    }%
 }%
%    \end{macrocode}
%
%
%\iffalse
%    \begin{macrocode}
%</datetime2-english-base.ldf>
%    \end{macrocode}
%\fi
%\subsection{Default English Code (\texttt{datetime2-english.ldf})}
% This file contains the style used if English is requested without
% a~known region. It uses \TeX's default date style.
% This style ignores the \opt{showdow} (show day of week) setting.
%\changes{1.0}{2015-03-24}{Initial release}
%
%\iffalse
%    \begin{macrocode}
%<*datetime2-english.ldf>
%    \end{macrocode}
%\fi
%
% Identify Module
%    \begin{macrocode}
\ProvidesDateTimeModule{english}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load the base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Define default English text style (TeX's default) labelled "english".
% The time zone is just the "default" style (no mappings applied)
% but "showisoZ" setting checked. The full style places a space
% between each block (date, time and zone). The numeric setting is
% ambiguous without a region so it will use the "default" style.
%    \begin{macrocode}
\DTMnewstyle
 {english}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}[1]{}%
   \renewcommand*\DTMdisplaydate[4]{%
     \DTMenglishmonthname{##2}\space\number##3, \number##1
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*{\DTMenglishtimesep}{\DTMsep{hourmin}}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMsetzonestyle{default}%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \space
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \space
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
% Switch the style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{english}}%
{\DTMsetstyle{default}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{%
  \ifundef\dateenglish
  {% do nothing
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{english}}%
      {\DTMsetstyle{default}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{english}}%
    {\DTMsetstyle{default}}%
  }%
}%
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</datetime2-english.ldf>
%    \end{macrocode}
%\fi
%
%\subsection{English (GB) Code (\texttt{datetime2-en-GB.ldf})}
%This file contains the British English style.
%\changes{1.0}{2015-03-24}{Initial release}
%\iffalse
%    \begin{macrocode}
%<*datetime2-en-GB.ldf>
%    \end{macrocode}
%\fi
% Identify this module.
%    \begin{macrocode}
\ProvidesDateTimeModule{en-GB}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Allow the user a way of configuring the "en-GB" and
% "en-GB-numeric" styles. This doesn't use the package wide separators such as
% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMenGBdaymonthsep}
% The separator between the day and month for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenGBdaymonthsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenGBmonthyearsep}
% The separator between the month and year for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenGBmonthyearsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenGBdatetimesep}
% The separator between the date and time blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenGBdatetimesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenGBtimezonesep}
% The separator between the time and zone blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenGBtimezonesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenGBdatesep}
% The separator for the numeric date format.
%    \begin{macrocode}
\newcommand*{\DTMenGBdatesep}{/}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenGBtimesep}
% The separator for the numeric time format.
%    \begin{macrocode}
\newcommand*{\DTMenGBtimesep}{:}
%    \end{macrocode}
%\end{macro}
%
%Provide keys that can be used in \cs{DTMlangsetup} to set these
%separators.
%    \begin{macrocode}
\DTMdefkey{en-GB}{daymonthsep}{\renewcommand*{\DTMenGBdaymonthsep}{#1}}
\DTMdefkey{en-GB}{monthyearsep}{\renewcommand*{\DTMenGBmonthyearsep}{#1}}
\DTMdefkey{en-GB}{datetimesep}{\renewcommand*{\DTMenGBdatetimesep}{#1}}
\DTMdefkey{en-GB}{timezonesep}{\renewcommand*{\DTMenGBtimezonesep}{#1}}
\DTMdefkey{en-GB}{datesep}{\renewcommand*{\DTMenGBdatesep}{#1}}
\DTMdefkey{en-GB}{timesep}{\renewcommand*{\DTMenGBtimesep}{#1}}
%    \end{macrocode}
%
% Define a boolean key that can switch between full and abbreviated
% formats for the month and day of week names in the text format.
%    \begin{macrocode}
\DTMdefboolkey{en-GB}{abbr}[true]{}
%    \end{macrocode}
% The default is the full name.
%    \begin{macrocode}
\DTMsetbool{en-GB}{abbr}{false}
%    \end{macrocode}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
%    \begin{macrocode}
\DTMdefboolkey{en-GB}{mapzone}[true]{}
%    \end{macrocode}
% The default is to use mappings.
%    \begin{macrocode}
\DTMsetbool{en-GB}{mapzone}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% day of the month. (Called "showdayofmonth" instead of "showday" to
% avoid confusion with the day of the week.)
%    \begin{macrocode}
\DTMdefboolkey{en-GB}{showdayofmonth}[true]{}
%    \end{macrocode}
% The default is to show the day of the month.
%    \begin{macrocode}
\DTMsetbool{en-GB}{showdayofmonth}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% year.
%    \begin{macrocode}
\DTMdefboolkey{en-GB}{showyear}[true]{}
%    \end{macrocode}
% The default is to show the year.
%    \begin{macrocode}
\DTMsetbool{en-GB}{showyear}{true}
%    \end{macrocode}
%
%\begin{macro}{\DTMenGBfmtordsuffix}
% Define the ordinal suffix to be used by this style.
%    \begin{macrocode}
\newcommand*{\DTMenGBfmtordsuffix}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
% Define a setting to change the ordinal suffix style.
%    \begin{macrocode}
\DTMdefchoicekey{en-GB}{ord}[\val\nr]{level,raise,omit,sc}{%
 \ifcase\nr\relax
   \renewcommand*{\DTMenGBfmtordsuffix}[1]{##1}%
 \or
   \renewcommand*{\DTMenGBfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsuperscript{##1}}{##1}}%
 \or
   \renewcommand*{\DTMenGBfmtordsuffix}[1]{}%
 \or
   \renewcommand*{\DTMenGBfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsc{##1}}{##1}}%
 \fi
}
%    \end{macrocode}
%
% Define the "en-GB" style.
%    \begin{macrocode}
\DTMnewstyle
 {en-GB}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}{\DTMenGBfmtordsuffix}%
   \renewcommand*\DTMdisplaydate[4]{%
     \ifDTMshowdow
       \ifnum##4>-1
        \DTMifbool{en-GB}{abbr}%
         {\DTMenglishshortweekdayname{##4}}%
         {\DTMenglishweekdayname{##4}}%
        \space
       \fi
     \fi
     \DTMifbool{en-GB}{showdayofmonth}%
     {%
       \DTMenglishordinal{##3}%
       \DTMenGBdaymonthsep
     }%
     {}%
     \DTMifbool{en-GB}{abbr}%
     {\DTMenglishshortmonthname{##2}}%
     {\DTMenglishmonthname{##2}}%
     \DTMifbool{en-GB}{showyear}%
     {%
       \DTMenGBmonthyearsep\number##1 % space intended
     }%
     {}%
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*\DTMenglishtimesep{\DTMenGBtimesep}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMresetzones
   \DTMenGBzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-GB}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenGBtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenGBdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenGBtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
%
% Define numeric style.
%    \begin{macrocode}
\DTMnewstyle
 {en-GB-numeric}% label
 {% date style
    \renewcommand*\DTMdisplaydate[4]{%
      \DTMifbool{en-GB}{showdayofmonth}%
      {%
        \number##3 % space intended
        \DTMenGBdatesep
      }%
      {}%
      \number##2 % space intended
      \DTMifbool{en-GB}{showyear}%
      {%
        \DTMenGBdatesep
        \number##1 % space intended
      }%
      {}%
    }%
    \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
    \renewcommand*\DTMdisplaytime[3]{%
      \number##1
      \DTMenGBtimesep\DTMtwodigits{##2}%
      \ifDTMshowseconds\DTMenGBtimesep\DTMtwodigits{##3}\fi
    }%
 }%
 {% zone style
   \DTMresetzones
   \DTMenGBzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-GB}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenGBtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenGBdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenGBtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }
%    \end{macrocode}
%
%\begin{macro}{\DTMenGBzonemaps}
% The time zone mappings are set through this command, which can be
% redefined if extra mappings are required or mappings need to be
% removed.
%    \begin{macrocode}
\newcommand*{\DTMenGBzonemaps}{%
  \DTMdefzonemap{00}{00}{GMT}%
  \DTMdefzonemap{01}{00}{BST}%
}
%    \end{macrocode}
%\end{macro}
%
% Switch style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{en-GB}}%
{\DTMsetstyle{en-GB-numeric}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{% do nothing
  \ifundef\dateenglish
  {%
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{en-GB}}%
      {\DTMsetstyle{en-GB-numeric}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{en-GB}}%
    {\DTMsetstyle{en-GB-regional}}%
  }%
}%
%    \end{macrocode}
%
%\iffalse
%    \begin{macrocode}
%</datetime2-en-GB.ldf>
%    \end{macrocode}
%\fi
%\subsection{English (US) Code (\texttt{datetime2-en-US.ldf})}
%This file contains the US English style.
%\changes{1.0}{2015-03-24}{Initial release}
%\iffalse
%    \begin{macrocode}
%<*datetime2-en-US.ldf>
%    \end{macrocode}
%\fi
%
% Identify this module.
%    \begin{macrocode}
\ProvidesDateTimeModule{en-US}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Allow the user a way of configuring the "en-US" date format.
% This doesn't use the package wide separators such as
% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMenUSmonthdaysep}
% The separator between the month and day for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenUSmonthdaysep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenUSdayyearsep}
% The separator between the day and year for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenUSdayyearsep}{,\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenUSdatetimesep}
% The separator between the date and time blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenUSdatetimesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenUStimezonesep}
% The separator between the time and zone blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenUStimezonesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenUSdatesep}
% The separator for the numeric date format.
%    \begin{macrocode}
\newcommand*{\DTMenUSdatesep}{/}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenUStimesep}
% The separator for the numeric time format.
%    \begin{macrocode}
\newcommand*{\DTMenUStimesep}{:}
%    \end{macrocode}
%\end{macro}
%
%Provide keys that can be used in \cs{DTMlangsetup} to set these
%separators.
%    \begin{macrocode}
\DTMdefkey{en-US}{monthdaysep}{\renewcommand*{\DTMenUSmonthdaysep}{#1}}
\DTMdefkey{en-US}{dayyearsep}{\renewcommand*{\DTMenUSdayyearsep}{#1}}
\DTMdefkey{en-US}{datetimesep}{\renewcommand*{\DTMenUSdatetimesep}{#1}}
\DTMdefkey{en-US}{timezonesep}{\renewcommand*{\DTMenUStimezonesep}{#1}}
\DTMdefkey{en-US}{datesep}{\renewcommand*{\DTMenUSdatesep}{#1}}
\DTMdefkey{en-US}{timesep}{\renewcommand*{\DTMenUStimesep}{#1}}
%    \end{macrocode}
%
% Define a boolean key that can switch between full and abbreviated
% formats for the month and day of week names in the text format.
%    \begin{macrocode}
\DTMdefboolkey{en-US}{abbr}[true]{}
%    \end{macrocode}
% The default is the full name.
%    \begin{macrocode}
\DTMsetbool{en-US}{abbr}{false}
%    \end{macrocode}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
%    \begin{macrocode}
\DTMdefboolkey{en-US}{mapzone}[true]{}
%    \end{macrocode}
% The default is no mappings.
%    \begin{macrocode}
\DTMsetbool{en-US}{mapzone}{false}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% day of the month. (Called "showdayofmonth" instead of "showday" to
% avoid confusion with the day of the week.)
%    \begin{macrocode}
\DTMdefboolkey{en-US}{showdayofmonth}[true]{}
%    \end{macrocode}
% The default is to show the day of the month.
%    \begin{macrocode}
\DTMsetbool{en-US}{showdayofmonth}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% year.
%    \begin{macrocode}
\DTMdefboolkey{en-US}{showyear}[true]{}
%    \end{macrocode}
% The default is to show the year.
%    \begin{macrocode}
\DTMsetbool{en-US}{showyear}{true}
%    \end{macrocode}
%
%\begin{macro}{\DTMenUSfmtordsuffix}
% Define the ordinal suffix to be used by this style.
%    \begin{macrocode}
\newcommand*{\DTMenUSfmtordsuffix}[1]{}
%    \end{macrocode}
%\end{macro}
%
% Define a setting to change the ordinal suffix style.
%    \begin{macrocode}
\DTMdefchoicekey{en-US}{ord}[\val\nr]{level,raise,omit,sc}{%
 \ifcase\nr\relax
   \renewcommand*{\DTMenUSfmtordsuffix}[1]{##1}%
 \or
   \renewcommand*{\DTMenUSfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsuperscript{##1}}{##1}}%
 \or
   \renewcommand*{\DTMenUSfmtordsuffix}[1]{}%
 \or
   \renewcommand*{\DTMenUSfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsc{##1}}{##1}}%
 \fi
}
%    \end{macrocode}
%
% Define the "en-US" style. Hiding the day of month is a bit awkward
% as the default day-year separator has a comma that should
% disappear if the day number is missing so the month-day separator
% is used as the month-year separator if the day is missing.
%    \begin{macrocode}
\DTMnewstyle
 {en-US}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}{\DTMenUSfmtordsuffix}%
   \renewcommand*\DTMdisplaydate[4]{%
     \DTMifbool{en-US}{abbr}%
     {\DTMenglishshortmonthname{##2}}%
     {\DTMenglishmonthname{##2}}%
     \DTMifbool{en-US}{showdayofmonth}%
     {%
       \DTMenUSmonthdaysep
       \DTMenglishordinal{##3}%
       \DTMifbool{en-US}{showyear}%
       {%
         \DTMenUSdayyearsep
         \number##1 % intended
       }%
       {}%
     }%
     {%
       \DTMifbool{en-US}{showyear}%
       {%
         \DTMenUSmonthdaysep
         \number##1 % intended
       }%
       {}%
     }%
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*\DTMenglishtimesep{\DTMenUStimesep}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMresetzones
   \DTMenUSzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-US}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenUStimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenUSdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenUStimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
%
% Define numeric style.
%    \begin{macrocode}
\DTMnewstyle
 {en-US-numeric}% label
 {% date style
    \renewcommand*\DTMdisplaydate[4]{%
      \number##2 % space intended
      \DTMifbool{en-US}{showdayofmonth}%
      {%
        \DTMenUSdatesep
        \number##3 % space intended
      }%
      {}%
      \DTMifbool{en-US}{showyear}%
      {%
        \DTMenUSdatesep
        \number##1 % space intended
      }%
      {}%
    }%
    \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
    \renewcommand*\DTMdisplaytime[3]{%
      \number##1
      \DTMenUStimesep\DTMtwodigits{##2}%
      \ifDTMshowseconds\DTMenUStimesep\DTMtwodigits{##3}\fi
    }%
 }%
 {% zone style
   \DTMresetzones
   \DTMenUSzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-US}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenUStimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenUSdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenUStimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }
%    \end{macrocode}
%
%\begin{macro}{\DTMenUSzonemaps}
% The time zone mappings are set through this command, which can be
% redefined if extra mappings are required or mappings need to be
% removed. (These don't take daylight saving into account.)
%    \begin{macrocode}
\newcommand*{\DTMenUSzonemaps}{%
  \DTMdefzonemap{-3}{00}{ADT}%
  \DTMdefzonemap{-4}{00}{AST}%
  \DTMdefzonemap{-5}{00}{EST}%
  \DTMdefzonemap{-6}{00}{CST}%
  \DTMdefzonemap{-7}{00}{MST}%
  \DTMdefzonemap{-8}{00}{PST}%
}
%    \end{macrocode}
%\end{macro}
%
%
% Switch style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{en-US}}%
{\DTMsetstyle{en-US-numeric}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{% do nothing
  \ifundef\dateenglish
  {%
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{en-US}}%
      {\DTMsetstyle{en-US-numeric}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{en-US}}%
    {\DTMsetstyle{en-US-regional}}%
  }%
}%
%    \end{macrocode}
%
%\iffalse
%    \begin{macrocode}
%</datetime2-en-US.ldf>
%    \end{macrocode}
%\fi
%\subsection{English (Canada) Code (\texttt{datetime2-en-CA.ldf})}
%This file contains the Canadian English style. This is very similar
%to the US style.
%\changes{1.0}{2015-03-24}{Initial release}
%\iffalse
%    \begin{macrocode}
%<*datetime2-en-CA.ldf>
%    \end{macrocode}
%\fi
%
% Identify this module.
%    \begin{macrocode}
\ProvidesDateTimeModule{en-CA}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Allow the user a way of configuring the "en-CA" and
% "en-CA-numeric" formats. This doesn't use the package wide separators such as
% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMenCAmonthdaysep}
% The separator between the month and day for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenCAmonthdaysep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenCAdayyearsep}
% The separator between the day and year for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenCAdayyearsep}{,\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenCAdatetimesep}
% The separator between the date and time blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenCAdatetimesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenCAtimezonesep}
% The separator between the time and zone blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenCAtimezonesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenCAdatesep}
% The separator for the numeric date format.
%    \begin{macrocode}
\newcommand*{\DTMenCAdatesep}{/}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenCAtimesep}
% The separator for the numeric time format.
%    \begin{macrocode}
\newcommand*{\DTMenCAtimesep}{:}
%    \end{macrocode}
%\end{macro}
%
%Provide keys that can be used in \cs{DTMlangsetup} to set these
%separators.
%    \begin{macrocode}
\DTMdefkey{en-CA}{monthdaysep}{\renewcommand*{\DTMenCAmonthdaysep}{#1}}
\DTMdefkey{en-CA}{dayyearsep}{\renewcommand*{\DTMenCAdayyearsep}{#1}}
\DTMdefkey{en-CA}{datetimesep}{\renewcommand*{\DTMenCAdatetimesep}{#1}}
\DTMdefkey{en-CA}{timezonesep}{\renewcommand*{\DTMenCAtimezonesep}{#1}}
\DTMdefkey{en-CA}{datesep}{\renewcommand*{\DTMenCAdatesep}{#1}}
\DTMdefkey{en-CA}{timesep}{\renewcommand*{\DTMenCAtimesep}{#1}}
%    \end{macrocode}
%
% Define a boolean key that can switch between full and abbreviated
% formats for the month and day of week names in the text format.
%    \begin{macrocode}
\DTMdefboolkey{en-CA}{abbr}[true]{}
%    \end{macrocode}
% The default is the full name.
%    \begin{macrocode}
\DTMsetbool{en-CA}{abbr}{false}
%    \end{macrocode}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
%    \begin{macrocode}
\DTMdefboolkey{en-CA}{mapzone}[true]{}
%    \end{macrocode}
% The default is no mappings.
%    \begin{macrocode}
\DTMsetbool{en-CA}{mapzone}{false}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% day of the month. (Called "showdayofmonth" instead of "showday" to
% avoid confusion with the day of the week.)
%    \begin{macrocode}
\DTMdefboolkey{en-CA}{showdayofmonth}[true]{}
%    \end{macrocode}
% The default is to show the day of the month.
%    \begin{macrocode}
\DTMsetbool{en-CA}{showdayofmonth}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% year.
%    \begin{macrocode}
\DTMdefboolkey{en-CA}{showyear}[true]{}
%    \end{macrocode}
% The default is to show the year.
%    \begin{macrocode}
\DTMsetbool{en-CA}{showyear}{true}
%    \end{macrocode}
%
%\begin{macro}{\DTMenCAfmtordsuffix}
% Define the ordinal suffix to be used by this style.
%    \begin{macrocode}
\newcommand*{\DTMenCAfmtordsuffix}[1]{}
%    \end{macrocode}
%\end{macro}
%
% Define a setting to change the ordinal suffix style.
%    \begin{macrocode}
\DTMdefchoicekey{en-CA}{ord}[\val\nr]{level,raise,omit,sc}{%
 \ifcase\nr\relax
   \renewcommand*{\DTMenCAfmtordsuffix}[1]{##1}%
 \or
   \renewcommand*{\DTMenCAfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsuperscript{##1}}{##1}}%
 \or
   \renewcommand*{\DTMenCAfmtordsuffix}[1]{}%
 \or
   \renewcommand*{\DTMenCAfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsc{##1}}{##1}}%
 \fi
}
%    \end{macrocode}
%
% Define the "en-CA" style (similar to "en-US").
%    \begin{macrocode}
\DTMnewstyle
 {en-CA}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}{\DTMenCAfmtordsuffix}%
   \renewcommand*\DTMdisplaydate[4]{%
     \DTMifbool{en-CA}{abbr}%
     {\DTMenglishshortmonthname{##2}}%
     {\DTMenglishmonthname{##2}}%
     \DTMifbool{en-CA}{showdayofmonth}%
     {%
       \DTMenCAmonthdaysep
       \DTMenglishordinal{##3}%
       \DTMifbool{en-CA}{showyear}%
       {%
         \DTMenCAdayyearsep
         \number##1 % intended
       }%
       {}%
     }%
     {%
       \DTMifbool{en-CA}{showyear}%
       {%
         \DTMenCAmonthdaysep
         \number##1 % intended
       }%
       {}%
     }%
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*\DTMenglishtimesep{\DTMenCAtimesep}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMresetzones
   \DTMenCAzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-CA}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenCAtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenCAdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenCAtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
%
% Define numeric style.
%    \begin{macrocode}
\DTMnewstyle
 {en-CA-numeric}% label
 {% date style
    \renewcommand*\DTMdisplaydate[4]{%
      \number##2 % space intended
      \DTMifbool{en-CA}{showdayofmonth}%
      {%
        \DTMenCAdatesep
        \number##3 % space intended
      }%
      {}%
      \DTMifbool{en-CA}{showyear}%
      {%
        \DTMenCAdatesep
        \number##1 % space intended
      }%
      {}%
    }%
    \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
    \renewcommand*\DTMdisplaytime[3]{%
      \number##1
      \DTMenCAtimesep\DTMtwodigits{##2}%
      \ifDTMshowseconds\DTMenCAtimesep\DTMtwodigits{##3}\fi
    }%
 }%
 {% zone style
   \DTMresetzones
   \DTMenCAzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-CA}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenCAtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenCAdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenCAtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }
%    \end{macrocode}
%
%\begin{macro}{\DTMenCAzonemaps}
% The time zone mappings are set through this command, which can be
% redefined if extra mappings are required or mappings need to be
% removed. (These don't take daylight saving into account, except
% for NDT.)
%    \begin{macrocode}
\newcommand*{\DTMenCAzonemaps}{%
  \DTMdefzonemap{-2}{30}{NDT}%
  \DTMdefzonemap{-3}{30}{NST}%
  \DTMdefzonemap{-4}{00}{AST}%
  \DTMdefzonemap{-5}{00}{EST}%
  \DTMdefzonemap{-6}{00}{CST}%
  \DTMdefzonemap{-7}{00}{MST}%
  \DTMdefzonemap{-8}{00}{PST}%
}
%    \end{macrocode}
%\end{macro}
%
%
% Switch style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{en-CA}}%
{\DTMsetstyle{en-CA-numeric}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{% do nothing
  \ifundef\dateenglish
  {%
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{en-CA}}%
      {\DTMsetstyle{en-CA-numeric}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{en-CA}}%
    {\DTMsetstyle{en-CA-regional}}%
  }%
}%
%    \end{macrocode}
%
%\iffalse
%    \begin{macrocode}
%</datetime2-en-CA.ldf>
%    \end{macrocode}
%\fi
%\subsection{English (Australia) Code (\texttt{datetime2-en-AU.ldf})}
%This file contains the Australian English style.
%\changes{1.0}{2015-03-24}{Initial release}
%\iffalse
%    \begin{macrocode}
%<*datetime2-en-AU.ldf>
%    \end{macrocode}
%\fi
%
% Identify this module.
%    \begin{macrocode}
\ProvidesDateTimeModule{en-AU}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Allow the user a way of configuring the "en-AU" and
% "en-AU-numeric" styles. This doesn't use the package wide separators such as
% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMenAUdaymonthsep}
% The separator between the day and month for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenAUdaymonthsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenAUmonthyearsep}
% The separator between the month and year for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenAUmonthyearsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenAUdatetimesep}
% The separator between the date and time blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenAUdatetimesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenAUtimezonesep}
% The separator between the time and zone blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenAUtimezonesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenAUdatesep}
% The separator for the numeric date format.
%    \begin{macrocode}
\newcommand*{\DTMenAUdatesep}{/}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenAUtimesep}
% The separator for the numeric time format.
%    \begin{macrocode}
\newcommand*{\DTMenAUtimesep}{:}
%    \end{macrocode}
%\end{macro}
%
%Provide keys that can be used in \cs{DTMlangsetup} to set these
%separators.
%    \begin{macrocode}
\DTMdefkey{en-AU}{daymonthsep}{\renewcommand*{\DTMenAUdaymonthsep}{#1}}
\DTMdefkey{en-AU}{monthyearsep}{\renewcommand*{\DTMenAUmonthyearsep}{#1}}
\DTMdefkey{en-AU}{datetimesep}{\renewcommand*{\DTMenAUdatetimesep}{#1}}
\DTMdefkey{en-AU}{timezonesep}{\renewcommand*{\DTMenAUtimezonesep}{#1}}
\DTMdefkey{en-AU}{datesep}{\renewcommand*{\DTMenAUdatesep}{#1}}
\DTMdefkey{en-AU}{timesep}{\renewcommand*{\DTMenAUtimesep}{#1}}
%    \end{macrocode}
%
% Define a boolean key that can switch between full and abbreviated
% formats for the month and day of week names in the text format.
%    \begin{macrocode}
\DTMdefboolkey{en-AU}{abbr}[true]{}
%    \end{macrocode}
% The default is the full name.
%    \begin{macrocode}
\DTMsetbool{en-AU}{abbr}{false}
%    \end{macrocode}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
%    \begin{macrocode}
\DTMdefboolkey{en-AU}{mapzone}[true]{}
%    \end{macrocode}
% The default is no mappings.
%    \begin{macrocode}
\DTMsetbool{en-AU}{mapzone}{false}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% day of the month. (Called "showdayofmonth" instead of "showday" to
% avoid confusion with the day of the week.)
%    \begin{macrocode}
\DTMdefboolkey{en-AU}{showdayofmonth}[true]{}
%    \end{macrocode}
% The default is to show the day of the month.
%    \begin{macrocode}
\DTMsetbool{en-AU}{showdayofmonth}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% year.
%    \begin{macrocode}
\DTMdefboolkey{en-AU}{showyear}[true]{}
%    \end{macrocode}
% The default is to show the year.
%    \begin{macrocode}
\DTMsetbool{en-AU}{showyear}{true}
%    \end{macrocode}
%
%\begin{macro}{\DTMenAUfmtordsuffix}
% Define the ordinal suffix to be used by this style.
%    \begin{macrocode}
\newcommand*{\DTMenAUfmtordsuffix}[1]{}
%    \end{macrocode}
%\end{macro}
%
% Define a setting to change the ordinal suffix style.
%    \begin{macrocode}
\DTMdefchoicekey{en-AU}{ord}[\val\nr]{level,raise,omit,sc}{%
 \ifcase\nr\relax
   \renewcommand*{\DTMenAUfmtordsuffix}[1]{##1}%
 \or
   \renewcommand*{\DTMenAUfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsuperscript{##1}}{##1}}%
 \or
   \renewcommand*{\DTMenAUfmtordsuffix}[1]{}%
 \or
   \renewcommand*{\DTMenAUfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsc{##1}}{##1}}%
 \fi
}
%    \end{macrocode}
%
% Define the "en-AU" style.
%    \begin{macrocode}
\DTMnewstyle
 {en-AU}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}{\DTMenAUfmtordsuffix}%
   \renewcommand*\DTMdisplaydate[4]{%
     \ifDTMshowdow
       \ifnum##4>-1%
        \DTMifbool{en-AU}{abbr}%
         {\DTMenglishshortweekdayname{##4}}%
         {\DTMenglishweekdayname{##4}}%
        \space
       \fi
     \fi
     \DTMifbool{en-AU}{showdayofmonth}%
     {%
       \DTMenglishordinal{##3}%
       \DTMenAUdaymonthsep
     }%
     {}%
     \DTMifbool{en-AU}{abbr}%
     {\DTMenglishshortmonthname{##2}}%
     {\DTMenglishmonthname{##2}}%
     \DTMifbool{en-AU}{showyear}%
     {%
       \DTMenAUmonthyearsep\number##1 % space intended
     }%
     {}%
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*\DTMenglishtimesep{\DTMenAUtimesep}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMresetzones
   \DTMenAUzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-AU}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenAUtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenAUdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenAUtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
%
% Define numeric style.
%    \begin{macrocode}
\DTMnewstyle
 {en-AU-numeric}% label
 {% date style
    \renewcommand*\DTMdisplaydate[4]{%
      \DTMifbool{en-AU}{showdayofmonth}%
      {%
      \number##3 % space intended
      \DTMenAUdatesep
      }%
      {}%
      \number##2 % space intended
      \DTMifbool{en-AU}{showyear}%
      {%
        \DTMenAUdatesep
        \number##1 % space intended
      }%
      {}%
    }%
    \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
    \renewcommand*\DTMdisplaytime[3]{%
      \number##1
      \DTMenAUtimesep\DTMtwodigits{##2}%
      \ifDTMshowseconds\DTMenAUtimesep\DTMtwodigits{##3}\fi
    }%
 }%
 {% zone style
   \DTMresetzones
   \DTMenAUzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-AU}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenAUtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenAUdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenAUtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }
%    \end{macrocode}
%
%\begin{macro}{\DTMenAUzonemaps}
% The time zone mappings are set through this command, which can be
% redefined if extra mappings are required or mappings need to be
% removed.
%    \begin{macrocode}
\newcommand*{\DTMenAUzonemaps}{%
  \DTMdefzonemap{10}{30}{ACDT}% Australian Central Daylight Time
  \DTMdefzonemap{11}{00}{AEDT}% Australian Eastern Daylight Time
  \DTMdefzonemap{9}{00}{AWDT}% Australian Western Daylight Time
  \DTMdefzonemap{9}{30}{ACST}% Australian Central Standard Time
  \DTMdefzonemap{8}{45}{ACWST}% Australian Central Western Standard Time
  \DTMdefzonemap{10}{00}{AEDT}% Australian Eastern Standard Time
  \DTMdefzonemap{8}{00}{AWDT}% Australian Western Standard Time
  \DTMdefzonemap{7}{00}{CXT}% Christmas Island Time
  \DTMdefzonemap{11}{30}{NFT}% Norfolk Island Time
}
%    \end{macrocode}
%\end{macro}
%
%
% Switch style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{en-AU}}%
{\DTMsetstyle{en-AU-numeric}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{% do nothing
  \ifundef\dateenglish
  {%
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{en-AU}}%
      {\DTMsetstyle{en-AU-numeric}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{en-AU}}%
    {\DTMsetstyle{en-AU-regional}}%
  }%
}%
%    \end{macrocode}
%
%\iffalse
%    \begin{macrocode}
%</datetime2-en-AU.ldf>
%    \end{macrocode}
%\fi
%\subsection{English (New Zealand) Code (\texttt{datetime2-en-NZ.ldf})}
%This file contains the New Zealand English style.
%\changes{1.0}{2015-03-24}{Initial release}
%\iffalse
%    \begin{macrocode}
%<*datetime2-en-NZ.ldf>
%    \end{macrocode}
%\fi
%
% Identify this module.
%    \begin{macrocode}
\ProvidesDateTimeModule{en-NZ}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Allow the user a way of configuring the "en-NZ" and
% "en-NZ-numeric" styles.
% This doesn't use the package wide separators such as
% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMenNZdaymonthsep}
% The separator between the day and month for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenNZdaymonthsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenNZmonthyearsep}
% The separator between the month and year for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenNZmonthyearsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenNZdatetimesep}
% The separator between the date and time blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenNZdatetimesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenNZtimezonesep}
% The separator between the time and zone blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenNZtimezonesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenNZdatesep}
% The separator for the numeric date format.
%    \begin{macrocode}
\newcommand*{\DTMenNZdatesep}{/}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenNZtimesep}
% The separator for the numeric time format.
%    \begin{macrocode}
\newcommand*{\DTMenNZtimesep}{:}
%    \end{macrocode}
%\end{macro}
%
%Provide keys that can be used in \cs{DTMlangsetup} to set these
%separators.
%    \begin{macrocode}
\DTMdefkey{en-NZ}{daymonthsep}{\renewcommand*{\DTMenNZdaymonthsep}{#1}}
\DTMdefkey{en-NZ}{monthyearsep}{\renewcommand*{\DTMenNZmonthyearsep}{#1}}
\DTMdefkey{en-NZ}{datetimesep}{\renewcommand*{\DTMenNZdatetimesep}{#1}}
\DTMdefkey{en-NZ}{timezonesep}{\renewcommand*{\DTMenNZtimezonesep}{#1}}
\DTMdefkey{en-NZ}{datesep}{\renewcommand*{\DTMenNZdatesep}{#1}}
\DTMdefkey{en-NZ}{timesep}{\renewcommand*{\DTMenNZtimesep}{#1}}
%    \end{macrocode}
%
% Define a boolean key that can switch between full and abbreviated
% formats for the month and day of week names in the text format.
%    \begin{macrocode}
\DTMdefboolkey{en-NZ}{abbr}[true]{}
%    \end{macrocode}
% The default is the full name.
%    \begin{macrocode}
\DTMsetbool{en-NZ}{abbr}{false}
%    \end{macrocode}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
%    \begin{macrocode}
\DTMdefboolkey{en-NZ}{mapzone}[true]{}
%    \end{macrocode}
% The default is no mappings.
%    \begin{macrocode}
\DTMsetbool{en-NZ}{mapzone}{false}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% day of the month. (Called "showdayofmonth" instead of "showday" to
% avoid confusion with the day of the week.)
%    \begin{macrocode}
\DTMdefboolkey{en-NZ}{showdayofmonth}[true]{}
%    \end{macrocode}
% The default is to show the day of the month.
%    \begin{macrocode}
\DTMsetbool{en-NZ}{showdayofmonth}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% year.
%    \begin{macrocode}
\DTMdefboolkey{en-NZ}{showyear}[true]{}
%    \end{macrocode}
% The default is to show the year.
%    \begin{macrocode}
\DTMsetbool{en-NZ}{showyear}{true}
%    \end{macrocode}
%
%\begin{macro}{\DTMenNZfmtordsuffix}
% Define the ordinal suffix to be used by this style.
%    \begin{macrocode}
\newcommand*{\DTMenNZfmtordsuffix}[1]{}
%    \end{macrocode}
%\end{macro}
%
% Define a setting to change the ordinal suffix style.
%    \begin{macrocode}
\DTMdefchoicekey{en-NZ}{ord}[\val\nr]{level,raise,omit,sc}{%
 \ifcase\nr\relax
   \renewcommand*{\DTMenNZfmtordsuffix}[1]{##1}%
 \or
   \renewcommand*{\DTMenNZfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsuperscript{##1}}{##1}}%
 \or
   \renewcommand*{\DTMenNZfmtordsuffix}[1]{}%
 \or
   \renewcommand*{\DTMenNZfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsc{##1}}{##1}}%
 \fi
}
%    \end{macrocode}
%
% Define the "en-NZ" style.
%    \begin{macrocode}
\DTMnewstyle
 {en-NZ}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}{\DTMenNZfmtordsuffix}%
   \renewcommand*\DTMdisplaydate[4]{%
     \ifDTMshowdow
       \ifnum##4>-1%
        \DTMifbool{en-NZ}{abbr}%
         {\DTMenglishshortweekdayname{##4}}%
         {\DTMenglishweekdayname{##4}}%
        \space
       \fi
     \fi
     \DTMifbool{en-NZ}{showdayofmonth}%
     {%
       \DTMenglishordinal{##3}%
       \DTMenNZdaymonthsep
     }%
     {}%
     \DTMifbool{en-NZ}{abbr}%
     {\DTMenglishshortmonthname{##2}}%
     {\DTMenglishmonthname{##2}}%
     \DTMifbool{en-NZ}{showyear}%
     {%
       \DTMenNZmonthyearsep\number##1 % space intended
     }%
     {}%
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*\DTMenglishtimesep{\DTMenNZtimesep}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMresetzones
   \DTMenNZzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-NZ}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenNZtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenNZdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenNZtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
%
% Define numeric style.
%    \begin{macrocode}
\DTMnewstyle
 {en-NZ-numeric}% label
 {% date style
    \renewcommand*\DTMdisplaydate[4]{%
      \DTMifbool{en-NZ}{showdayofmonth}%
      {%
        \number##3 % space intended
        \DTMenNZdatesep
      }%
      {}%
      \number##2 % space intended
      \DTMifbool{en-NZ}{showyear}%
      {%
        \DTMenNZdatesep
        \number##1 % space intended
      }%
      {}%
    }%
    \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
    \renewcommand*\DTMdisplaytime[3]{%
      \number##1
      \DTMenNZtimesep\DTMtwodigits{##2}%
      \ifDTMshowseconds\DTMenNZtimesep\DTMtwodigits{##3}\fi
    }%
 }%
 {% zone style
   \DTMresetzones
   \DTMenNZzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-NZ}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenNZtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenNZdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenNZtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }
%    \end{macrocode}
%
%\begin{macro}{\DTMenNZzonemaps}
% The time zone mappings are set through this command, which can be
% redefined if extra mappings are required or mappings need to be
% removed.
%    \begin{macrocode}
\newcommand*{\DTMenNZzonemaps}{%
  \DTMdefzonemap{12}{00}{NZST}%
  \DTMdefzonemap{12}{45}{CHAST}%
  \DTMdefzonemap{13}{00}{NZDT}%
  \DTMdefzonemap{13}{45}{CHADT}%
}
%    \end{macrocode}
%\end{macro}
%
% Switch style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{en-NZ}}%
{\DTMsetstyle{en-NZ-numeric}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{% do nothing
  \ifundef\dateenglish
  {%
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{en-NZ}}%
      {\DTMsetstyle{en-NZ-numeric}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{en-NZ}}%
    {\DTMsetstyle{en-NZ-regional}}%
  }%
}%
%    \end{macrocode}
%
%\iffalse
%    \begin{macrocode}
%</datetime2-en-NZ.ldf>
%    \end{macrocode}
%\fi
%\subsection{English (GG) Code (\texttt{datetime2-en-GG.ldf})}
%This file contains the \texttt{en-GG} style.
%\changes{1.0}{2015-03-24}{Initial release}
%\iffalse
%    \begin{macrocode}
%<*datetime2-en-GG.ldf>
%    \end{macrocode}
%\fi
%
% Identify this module.
%    \begin{macrocode}
\ProvidesDateTimeModule{en-GG}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Allow the user a way of configuring the "en-GG" and
% "en-GG-numeric" styles. This doesn't use the package wide separators such as
% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMenGGdaymonthsep}
% The separator between the day and month for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenGGdaymonthsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenGGmonthyearsep}
% The separator between the month and year for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenGGmonthyearsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenGGdatetimesep}
% The separator between the date and time blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenGGdatetimesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenGGtimezonesep}
% The separator between the time and zone blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenGGtimezonesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenGGdatesep}
% The separator for the numeric date format.
%    \begin{macrocode}
\newcommand*{\DTMenGGdatesep}{/}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenGGtimesep}
% The separator for the numeric time format.
%    \begin{macrocode}
\newcommand*{\DTMenGGtimesep}{:}
%    \end{macrocode}
%\end{macro}
%
%Provide keys that can be used in \cs{DTMlangsetup} to set these
%separators.
%    \begin{macrocode}
\DTMdefkey{en-GG}{daymonthsep}{\renewcommand*{\DTMenGGdaymonthsep}{#1}}
\DTMdefkey{en-GG}{monthyearsep}{\renewcommand*{\DTMenGGmonthyearsep}{#1}}
\DTMdefkey{en-GG}{datetimesep}{\renewcommand*{\DTMenGGdatetimesep}{#1}}
\DTMdefkey{en-GG}{timezonesep}{\renewcommand*{\DTMenGGtimezonesep}{#1}}
\DTMdefkey{en-GG}{datesep}{\renewcommand*{\DTMenGGdatesep}{#1}}
\DTMdefkey{en-GG}{timesep}{\renewcommand*{\DTMenGGtimesep}{#1}}
%    \end{macrocode}
%
% Define a boolean key that can switch between full and abbreviated
% formats for the month and day of week names in the text format.
%    \begin{macrocode}
\DTMdefboolkey{en-GG}{abbr}[true]{}
%    \end{macrocode}
% The default is the full name.
%    \begin{macrocode}
\DTMsetbool{en-GG}{abbr}{false}
%    \end{macrocode}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
%    \begin{macrocode}
\DTMdefboolkey{en-GG}{mapzone}[true]{}
%    \end{macrocode}
% The default is to use mappings.
%    \begin{macrocode}
\DTMsetbool{en-GG}{mapzone}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% day of the month. (Called "showdayofmonth" instead of "showday" to
% avoid confusion with the day of the week.)
%    \begin{macrocode}
\DTMdefboolkey{en-GG}{showdayofmonth}[true]{}
%    \end{macrocode}
% The default is to show the day of the month.
%    \begin{macrocode}
\DTMsetbool{en-GG}{showdayofmonth}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% year.
%    \begin{macrocode}
\DTMdefboolkey{en-GG}{showyear}[true]{}
%    \end{macrocode}
% The default is to show the year.
%    \begin{macrocode}
\DTMsetbool{en-GG}{showyear}{true}
%    \end{macrocode}
%
%\begin{macro}{\DTMenGGfmtordsuffix}
% Define the ordinal suffix to be used by this style.
%    \begin{macrocode}
\newcommand*{\DTMenGGfmtordsuffix}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
% Define a setting to change the ordinal suffix style.
%    \begin{macrocode}
\DTMdefchoicekey{en-GG}{ord}[\val\nr]{level,raise,omit,sc}{%
 \ifcase\nr\relax
   \renewcommand*{\DTMenGGfmtordsuffix}[1]{##1}%
 \or
   \renewcommand*{\DTMenGGfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsuperscript{##1}}{##1}}%
 \or
   \renewcommand*{\DTMenGGfmtordsuffix}[1]{}%
 \or
   \renewcommand*{\DTMenGGfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsc{##1}}{##1}}%
 \fi
}
%    \end{macrocode}
%
% Define the "en-GG" style.
%    \begin{macrocode}
\DTMnewstyle
 {en-GG}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}{\DTMenGGfmtordsuffix}%
   \renewcommand*\DTMdisplaydate[4]{%
     \ifDTMshowdow
       \ifnum##4>-1%
        \DTMifbool{en-GG}{abbr}%
         {\DTMenglishshortweekdayname{##4}}%
         {\DTMenglishweekdayname{##4}}%
        \space
       \fi
     \fi
     \DTMifbool{en-GG}{showdayofmonth}%
     {%
       \DTMenglishordinal{##3}%
       \DTMenGGdaymonthsep
     }%
     {}%
     \DTMifbool{en-GG}{abbr}%
     {\DTMenglishshortmonthname{##2}}%
     {\DTMenglishmonthname{##2}}%
     \DTMifbool{en-GG}{showyear}%
     {%
       \DTMenGGmonthyearsep\number##1 % space intended
     }%
     {}%
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*\DTMenglishtimesep{\DTMenGGtimesep}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMresetzones
   \DTMenGGzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-GG}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenGGtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenGGdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenGGtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
%
% Define numeric style.
%    \begin{macrocode}
\DTMnewstyle
 {en-GG-numeric}% label
 {% date style
    \renewcommand*\DTMdisplaydate[4]{%
      \DTMifbool{en-GG}{showdayofmonth}%
      {%
        \number##3 % space intended
        \DTMenGGdatesep
      }%
      {}%
      \number##2 % space intended
      \DTMifbool{en-GG}{showyear}%
      {%
        \DTMenGGdatesep
        \number##1 % space intended
      }%
      {}%
    }%
    \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
    \renewcommand*\DTMdisplaytime[3]{%
      \number##1
      \DTMenGGtimesep\DTMtwodigits{##2}%
      \ifDTMshowseconds\DTMenGGtimesep\DTMtwodigits{##3}\fi
    }%
 }%
 {% zone style
   \DTMresetzones
   \DTMenGGzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-GG}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenGGtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenGGdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenGGtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }
%    \end{macrocode}
%
%\begin{macro}{\DTMenGGzonemaps}
% The time zone mappings are set through this command, which can be
% redefined if extra mappings are required or mappings need to be
% removed.
%    \begin{macrocode}
\newcommand*{\DTMenGGzonemaps}{%
  \DTMdefzonemap{00}{00}{GMT}%
  \DTMdefzonemap{01}{00}{BST}%
}
%    \end{macrocode}
%\end{macro}
%
% Switch style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{en-GG}}%
{\DTMsetstyle{en-GG-numeric}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{% do nothing
  \ifundef\dateenglish
  {%
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{en-GG}}%
      {\DTMsetstyle{en-GG-numeric}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{en-GG}}%
    {\DTMsetstyle{en-GG-regional}}%
  }%
}%
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</datetime2-en-GG.ldf>
%    \end{macrocode}
%\fi
%\subsection{English (JE) Code (\texttt{datetime2-en-JE.ldf})}
%This file contains the \texttt{en-JE} style.
%\changes{1.0}{2015-03-24}{Initial release}
%\iffalse
%    \begin{macrocode}
%<*datetime2-en-JE.ldf>
%    \end{macrocode}
%\fi
%
% Identify this module.
%    \begin{macrocode}
\ProvidesDateTimeModule{en-JE}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Allow the user a way of configuring the "en-JE" and
% "en-JE-numeric" styles. This doesn't use the package wide separators such as
% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMenJEdaymonthsep}
% The separator between the day and month for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenJEdaymonthsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenJEmonthyearsep}
% The separator between the month and year for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenJEmonthyearsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenJEdatetimesep}
% The separator between the date and time blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenJEdatetimesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenJEtimezonesep}
% The separator between the time and zone blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenJEtimezonesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenJEdatesep}
% The separator for the numeric date format.
%    \begin{macrocode}
\newcommand*{\DTMenJEdatesep}{/}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenJEtimesep}
% The separator for the numeric time format.
%    \begin{macrocode}
\newcommand*{\DTMenJEtimesep}{:}
%    \end{macrocode}
%\end{macro}
%
%Provide keys that can be used in \cs{DTMlangsetup} to set these
%separators.
%    \begin{macrocode}
\DTMdefkey{en-JE}{daymonthsep}{\renewcommand*{\DTMenJEdaymonthsep}{#1}}
\DTMdefkey{en-JE}{monthyearsep}{\renewcommand*{\DTMenJEmonthyearsep}{#1}}
\DTMdefkey{en-JE}{datetimesep}{\renewcommand*{\DTMenJEdatetimesep}{#1}}
\DTMdefkey{en-JE}{timezonesep}{\renewcommand*{\DTMenJEtimezonesep}{#1}}
\DTMdefkey{en-JE}{datesep}{\renewcommand*{\DTMenJEdatesep}{#1}}
\DTMdefkey{en-JE}{timesep}{\renewcommand*{\DTMenJEtimesep}{#1}}
%    \end{macrocode}
%
% Define a boolean key that can switch between full and abbreviated
% formats for the month and day of week names in the text format.
%    \begin{macrocode}
\DTMdefboolkey{en-JE}{abbr}[true]{}
%    \end{macrocode}
% The default is the full name.
%    \begin{macrocode}
\DTMsetbool{en-JE}{abbr}{false}
%    \end{macrocode}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
%    \begin{macrocode}
\DTMdefboolkey{en-JE}{mapzone}[true]{}
%    \end{macrocode}
% The default is to use mappings.
%    \begin{macrocode}
\DTMsetbool{en-JE}{mapzone}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% day of the month. (Called "showdayofmonth" instead of "showday" to
% avoid confusion with the day of the week.)
%    \begin{macrocode}
\DTMdefboolkey{en-JE}{showdayofmonth}[true]{}
%    \end{macrocode}
% The default is to show the day of the month.
%    \begin{macrocode}
\DTMsetbool{en-JE}{showdayofmonth}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% year.
%    \begin{macrocode}
\DTMdefboolkey{en-JE}{showyear}[true]{}
%    \end{macrocode}
% The default is to show the year.
%    \begin{macrocode}
\DTMsetbool{en-JE}{showyear}{true}
%    \end{macrocode}
%
%\begin{macro}{\DTMenJEfmtordsuffix}
% Define the ordinal suffix to be used by this style.
%    \begin{macrocode}
\newcommand*{\DTMenJEfmtordsuffix}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
% Define a setting to change the ordinal suffix style.
%    \begin{macrocode}
\DTMdefchoicekey{en-JE}{ord}[\val\nr]{level,raise,omit,sc}{%
 \ifcase\nr\relax
   \renewcommand*{\DTMenJEfmtordsuffix}[1]{##1}%
 \or
   \renewcommand*{\DTMenJEfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsuperscript{##1}}{##1}}%
 \or
   \renewcommand*{\DTMenJEfmtordsuffix}[1]{}%
 \or
   \renewcommand*{\DTMenJEfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsc{##1}}{##1}}%
 \fi
}
%    \end{macrocode}
%
% Define the "en-JE" style.
%    \begin{macrocode}
\DTMnewstyle
 {en-JE}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}{\DTMenJEfmtordsuffix}%
   \renewcommand*\DTMdisplaydate[4]{%
     \ifDTMshowdow
       \ifnum##4>-1%
        \DTMifbool{en-JE}{abbr}%
         {\DTMenglishshortweekdayname{##4}}%
         {\DTMenglishweekdayname{##4}}%
        \space
       \fi
     \fi
     \DTMifbool{en-JE}{showdayofmonth}%
     {%
       \DTMenglishordinal{##3}%
       \DTMenJEdaymonthsep
     }%
     {}%
     \DTMifbool{en-JE}{abbr}%
     {\DTMenglishshortmonthname{##2}}%
     {\DTMenglishmonthname{##2}}%
     \DTMifbool{en-JE}{showyear}%
     {%
       \DTMenJEmonthyearsep\number##1 % space intended
     }%
     {}%
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*\DTMenglishtimesep{\DTMenJEtimesep}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMresetzones
   \DTMenJEzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-JE}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenJEtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenJEdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenJEtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
%
% Define numeric style.
%    \begin{macrocode}
\DTMnewstyle
 {en-JE-numeric}% label
 {% date style
    \renewcommand*\DTMdisplaydate[4]{%
      \DTMifbool{en-JE}{showdayofmonth}%
      {%
        \number##3 % space intended
        \DTMenJEdatesep
      }%
      {}%
      \number##2 % space intended
      \DTMifbool{en-JE}{showyear}%
      {%
        \DTMenJEdatesep
        \number##1 % space intended
      }%
      {}%
    }%
    \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
    \renewcommand*\DTMdisplaytime[3]{%
      \number##1
      \DTMenJEtimesep\DTMtwodigits{##2}%
      \ifDTMshowseconds\DTMenJEtimesep\DTMtwodigits{##3}\fi
    }%
 }%
 {% zone style
   \DTMresetzones
   \DTMenJEzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-JE}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenJEtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenJEdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenJEtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }
%    \end{macrocode}
%
%\begin{macro}{\DTMenJEzonemaps}
% The time zone mappings are set through this command, which can be
% redefined if extra mappings are required or mappings need to be
% removed.
%    \begin{macrocode}
\newcommand*{\DTMenJEzonemaps}{%
  \DTMdefzonemap{00}{00}{GMT}%
  \DTMdefzonemap{01}{00}{BST}%
}
%    \end{macrocode}
%\end{macro}
%
% Switch style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{en-JE}}%
{\DTMsetstyle{en-JE-numeric}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{% do nothing
  \ifundef\dateenglish
  {%
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{en-JE}}%
      {\DTMsetstyle{en-JE-numeric}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{en-JE}}%
    {\DTMsetstyle{en-JE-regional}}%
  }%
}%
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</datetime2-en-JE.ldf>
%    \end{macrocode}
%\fi
%\subsection{English (IM) Code (\texttt{datetime2-en-IM.ldf})}
%This file contains the \texttt{en-IM} style.
%\changes{1.0}{2015-03-24}{Initial release}
%\iffalse
%    \begin{macrocode}
%<*datetime2-en-IM.ldf>
%    \end{macrocode}
%\fi
%
% Identify this module.
%    \begin{macrocode}
\ProvidesDateTimeModule{en-IM}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Allow the user a way of configuring the "en-IM" and
% "en-IM-numeric" styles. This doesn't use the package wide separators such as
% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMenIMdaymonthsep}
% The separator between the day and month for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenIMdaymonthsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenIMmonthyearsep}
% The separator between the month and year for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenIMmonthyearsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenIMdatetimesep}
% The separator between the date and time blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenIMdatetimesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenIMtimezonesep}
% The separator between the time and zone blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenIMtimezonesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenIMdatesep}
% The separator for the numeric date format.
%    \begin{macrocode}
\newcommand*{\DTMenIMdatesep}{/}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenIMtimesep}
% The separator for the numeric time format.
%    \begin{macrocode}
\newcommand*{\DTMenIMtimesep}{:}
%    \end{macrocode}
%\end{macro}
%
%Provide keys that can be used in \cs{DTMlangsetup} to set these
%separators.
%    \begin{macrocode}
\DTMdefkey{en-IM}{daymonthsep}{\renewcommand*{\DTMenIMdaymonthsep}{#1}}
\DTMdefkey{en-IM}{monthyearsep}{\renewcommand*{\DTMenIMmonthyearsep}{#1}}
\DTMdefkey{en-IM}{datetimesep}{\renewcommand*{\DTMenIMdatetimesep}{#1}}
\DTMdefkey{en-IM}{timezonesep}{\renewcommand*{\DTMenIMtimezonesep}{#1}}
\DTMdefkey{en-IM}{datesep}{\renewcommand*{\DTMenIMdatesep}{#1}}
\DTMdefkey{en-IM}{timesep}{\renewcommand*{\DTMenIMtimesep}{#1}}
%    \end{macrocode}
%
% Define a boolean key that can switch between full and abbreviated
% formats for the month and day of week names in the text format.
%    \begin{macrocode}
\DTMdefboolkey{en-IM}{abbr}[true]{}
%    \end{macrocode}
% The default is the full name.
%    \begin{macrocode}
\DTMsetbool{en-IM}{abbr}{false}
%    \end{macrocode}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
%    \begin{macrocode}
\DTMdefboolkey{en-IM}{mapzone}[true]{}
%    \end{macrocode}
% The default is to use mappings.
%    \begin{macrocode}
\DTMsetbool{en-IM}{mapzone}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% day of the month. (Called "showdayofmonth" instead of "showday" to
% avoid confusion with the day of the week.)
%    \begin{macrocode}
\DTMdefboolkey{en-IM}{showdayofmonth}[true]{}
%    \end{macrocode}
% The default is to show the day of the month.
%    \begin{macrocode}
\DTMsetbool{en-IM}{showdayofmonth}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% year.
%    \begin{macrocode}
\DTMdefboolkey{en-IM}{showyear}[true]{}
%    \end{macrocode}
% The default is to show the year.
%    \begin{macrocode}
\DTMsetbool{en-IM}{showyear}{true}
%    \end{macrocode}
%
%\begin{macro}{\DTMenIMfmtordsuffix}
% Define the ordinal suffix to be used by this style.
%    \begin{macrocode}
\newcommand*{\DTMenIMfmtordsuffix}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
% Define a setting to change the ordinal suffix style.
%    \begin{macrocode}
\DTMdefchoicekey{en-IM}{ord}[\val\nr]{level,raise,omit,sc}{%
 \ifcase\nr\relax
   \renewcommand*{\DTMenIMfmtordsuffix}[1]{##1}%
 \or
   \renewcommand*{\DTMenIMfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsuperscript{##1}}{##1}}%
 \or
   \renewcommand*{\DTMenIMfmtordsuffix}[1]{}%
 \or
   \renewcommand*{\DTMenIMfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsc{##1}}{##1}}%
 \fi
}
%    \end{macrocode}
%
% Define the "en-IM" style.
%    \begin{macrocode}
\DTMnewstyle
 {en-IM}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}{\DTMenIMfmtordsuffix}%
   \renewcommand*\DTMdisplaydate[4]{%
     \ifDTMshowdow
       \ifnum##4>-1%
        \DTMifbool{en-IM}{abbr}%
         {\DTMenglishshortweekdayname{##4}}%
         {\DTMenglishweekdayname{##4}}%
        \space
       \fi
     \fi
     \DTMifbool{en-IM}{showdayofmonth}%
     {%
       \DTMenglishordinal{##3}%
       \DTMenIMdaymonthsep
     }%
     {}%
     \DTMifbool{en-IM}{abbr}%
     {\DTMenglishshortmonthname{##2}}%
     {\DTMenglishmonthname{##2}}%
     \DTMifbool{en-IM}{showyear}%
     {%
       \DTMenIMmonthyearsep\number##1 % space intended
     }%
     {}%
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*\DTMenglishtimesep{\DTMenIMtimesep}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMresetzones
   \DTMenIMzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-IM}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenIMtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenIMdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenIMtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
%
% Define numeric style.
%    \begin{macrocode}
\DTMnewstyle
 {en-IM-numeric}% label
 {% date style
    \renewcommand*\DTMdisplaydate[4]{%
      \DTMifbool{en-IM}{showdayofmonth}%
      {%
        \number##3 % space intended
        \DTMenIMdatesep
      }%
      {}%
      \number##2 % space intended
      \DTMifbool{en-IM}{showyear}%
      {%
        \DTMenIMdatesep
        \number##1 % space intended
      }%
      {}%
    }%
    \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
    \renewcommand*\DTMdisplaytime[3]{%
      \number##1
      \DTMenIMtimesep\DTMtwodigits{##2}%
      \ifDTMshowseconds\DTMenIMtimesep\DTMtwodigits{##3}\fi
    }%
 }%
 {% zone style
   \DTMresetzones
   \DTMenIMzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-IM}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenIMtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenIMdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenIMtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }
%    \end{macrocode}
%
%\begin{macro}{\DTMenIMzonemaps}
% The time zone mappings are set through this command, which can be
% redefined if extra mappings are required or mappings need to be
% removed.
%    \begin{macrocode}
\newcommand*{\DTMenIMzonemaps}{%
  \DTMdefzonemap{00}{00}{GMT}%
  \DTMdefzonemap{01}{00}{BST}%
}
%    \end{macrocode}
%\end{macro}
%
% Switch style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{en-IM}}%
{\DTMsetstyle{en-IM-numeric}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{% do nothing
  \ifundef\dateenglish
  {%
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{en-IM}}%
      {\DTMsetstyle{en-IM-numeric}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{en-IM}}%
    {\DTMsetstyle{en-IM-regional}}%
  }%
}%
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</datetime2-en-IM.ldf>
%    \end{macrocode}
%\fi
%\subsection{English (MT) Code (\texttt{datetime2-en-MT.ldf})}
%This file contains the \texttt{en-MT} style.
%\changes{1.0}{2015-03-24}{Initial release}
%\iffalse
%    \begin{macrocode}
%<*datetime2-en-MT.ldf>
%    \end{macrocode}
%\fi
%
% Identify this module.
%    \begin{macrocode}
\ProvidesDateTimeModule{en-MT}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Allow the user a way of configuring the "en-MT" and
% "en-MT-numeric" styles. This doesn't use the package wide separators such as
% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMenMTdaymonthsep}
% The separator between the day and month for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenMTdaymonthsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenMTmonthyearsep}
% The separator between the month and year for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenMTmonthyearsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenMTdatetimesep}
% The separator between the date and time blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenMTdatetimesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenMTtimezonesep}
% The separator between the time and zone blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenMTtimezonesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenMTdatesep}
% The separator for the numeric date format.
%    \begin{macrocode}
\newcommand*{\DTMenMTdatesep}{/}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenMTtimesep}
% The separator for the numeric time format.
%    \begin{macrocode}
\newcommand*{\DTMenMTtimesep}{:}
%    \end{macrocode}
%\end{macro}
%
%Provide keys that can be used in \cs{DTMlangsetup} to set these
%separators.
%    \begin{macrocode}
\DTMdefkey{en-MT}{daymonthsep}{\renewcommand*{\DTMenMTdaymonthsep}{#1}}
\DTMdefkey{en-MT}{monthyearsep}{\renewcommand*{\DTMenMTmonthyearsep}{#1}}
\DTMdefkey{en-MT}{datetimesep}{\renewcommand*{\DTMenMTdatetimesep}{#1}}
\DTMdefkey{en-MT}{timezonesep}{\renewcommand*{\DTMenMTtimezonesep}{#1}}
\DTMdefkey{en-MT}{datesep}{\renewcommand*{\DTMenMTdatesep}{#1}}
\DTMdefkey{en-MT}{timesep}{\renewcommand*{\DTMenMTtimesep}{#1}}
%    \end{macrocode}
%
% Define a boolean key that can switch between full and abbreviated
% formats for the month and day of week names in the text format.
%    \begin{macrocode}
\DTMdefboolkey{en-MT}{abbr}[true]{}
%    \end{macrocode}
% The default is the full name.
%    \begin{macrocode}
\DTMsetbool{en-MT}{abbr}{false}
%    \end{macrocode}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
%    \begin{macrocode}
\DTMdefboolkey{en-MT}{mapzone}[true]{}
%    \end{macrocode}
% The default is to use mappings.
%    \begin{macrocode}
\DTMsetbool{en-MT}{mapzone}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% day of the month. (Called "showdayofmonth" instead of "showday" to
% avoid confusion with the day of the week.)
%    \begin{macrocode}
\DTMdefboolkey{en-MT}{showdayofmonth}[true]{}
%    \end{macrocode}
% The default is to show the day of the month.
%    \begin{macrocode}
\DTMsetbool{en-MT}{showdayofmonth}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% year.
%    \begin{macrocode}
\DTMdefboolkey{en-MT}{showyear}[true]{}
%    \end{macrocode}
% The default is to show the year.
%    \begin{macrocode}
\DTMsetbool{en-MT}{showyear}{true}
%    \end{macrocode}
%
%\begin{macro}{\DTMenMTfmtordsuffix}
% Define the ordinal suffix to be used by this style.
%    \begin{macrocode}
\newcommand*{\DTMenMTfmtordsuffix}[1]{}
%    \end{macrocode}
%\end{macro}
%
% Define a setting to change the ordinal suffix style.
%    \begin{macrocode}
\DTMdefchoicekey{en-MT}{ord}[\val\nr]{level,raise,omit,sc}{%
 \ifcase\nr\relax
   \renewcommand*{\DTMenMTfmtordsuffix}[1]{##1}%
 \or
   \renewcommand*{\DTMenMTfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsuperscript{##1}}{##1}}%
 \or
   \renewcommand*{\DTMenMTfmtordsuffix}[1]{}%
 \or
   \renewcommand*{\DTMenMTfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsc{##1}}{##1}}%
 \fi
}
%    \end{macrocode}
%
% Define the "en-MT" style.
%    \begin{macrocode}
\DTMnewstyle
 {en-MT}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}{\DTMenMTfmtordsuffix}%
   \renewcommand*\DTMdisplaydate[4]{%
     \ifDTMshowdow
       \ifnum##4>-1%
        \DTMifbool{en-MT}{abbr}%
         {\DTMenglishshortweekdayname{##4}}%
         {\DTMenglishweekdayname{##4}}%
        \space
       \fi
     \fi
     \DTMifbool{en-MT}{showdayofmonth}%
     {%
       \DTMenglishordinal{##3}%
       \DTMenMTdaymonthsep
     }%
     {}%
     \DTMifbool{en-MT}{abbr}%
     {\DTMenglishshortmonthname{##2}}%
     {\DTMenglishmonthname{##2}}%
     \DTMifbool{en-MT}{showyear}%
     {%
       \DTMenMTmonthyearsep\number##1 % space intended
     }%
     {}%
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*\DTMenglishtimesep{\DTMenMTtimesep}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMresetzones
   \DTMenMTzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-MT}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenMTtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenMTdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenMTtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
%
% Define numeric style.
%    \begin{macrocode}
\DTMnewstyle
 {en-MT-numeric}% label
 {% date style
    \renewcommand*\DTMdisplaydate[4]{%
      \DTMifbool{en-MT}{showdayofmonth}%
      {%
        \number##3 % space intended
        \DTMenMTdatesep
      }%
      {}%
      \number##2 % space intended
      \DTMifbool{en-MT}{showyear}%
      {%
        \DTMenMTdatesep
        \number##1 % space intended
      }%
      {}%
    }%
    \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
    \renewcommand*\DTMdisplaytime[3]{%
      \number##1
      \DTMenMTtimesep\DTMtwodigits{##2}%
      \ifDTMshowseconds\DTMenMTtimesep\DTMtwodigits{##3}\fi
    }%
 }%
 {% zone style
   \DTMresetzones
   \DTMenMTzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-MT}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenMTtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenMTdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenMTtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }
%    \end{macrocode}
%
%\begin{macro}{\DTMenMTzonemaps}
% The time zone mappings are set through this command, which can be
% redefined if extra mappings are required or mappings need to be
% removed.
%    \begin{macrocode}
\newcommand*{\DTMenMTzonemaps}{%
  \DTMdefzonemap{02}{00}{CEST}%
  \DTMdefzonemap{01}{00}{CET}%
}
%    \end{macrocode}
%\end{macro}
%
% Switch style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{en-MT}}%
{\DTMsetstyle{en-MT-numeric}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{% do nothing
  \ifundef\dateenglish
  {%
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{en-MT}}%
      {\DTMsetstyle{en-MT-numeric}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{en-MT}}%
    {\DTMsetstyle{en-MT-regional}}%
  }%
}%
%    \end{macrocode}
%
%\iffalse
%    \begin{macrocode}
%</datetime2-en-MT.ldf>
%    \end{macrocode}
%\fi
%\subsection{English (IE) Code (\texttt{datetime2-en-IE.ldf})}
%This file contains the \texttt{en-IE} style.
%\changes{1.0}{2015-03-24}{Initial release}
%\iffalse
%    \begin{macrocode}
%<*datetime2-en-IE.ldf>
%    \end{macrocode}
%\fi
%
% Identify this module.
%    \begin{macrocode}
\ProvidesDateTimeModule{en-IE}[2015/03/24 v1.0 (NLCT)]
%    \end{macrocode}
% Load base English module.
%    \begin{macrocode}
\RequireDateTimeModule{english-base}
%    \end{macrocode}
%
% Allow the user a way of configuring the "en-IE" and
% "en-IE-numeric" styles. This doesn't use the package wide separators such as
% \cs{dtm@datetimesep} in case other date formats are also required.
%\begin{macro}{\DTMenIEdaymonthsep}
% The separator between the day and month for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenIEdaymonthsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenIEmonthyearsep}
% The separator between the month and year for the text format.
%    \begin{macrocode}
\newcommand*{\DTMenIEmonthyearsep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenIEdatetimesep}
% The separator between the date and time blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenIEdatetimesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenIEtimezonesep}
% The separator between the time and zone blocks in the full format
% (either text or numeric).
%    \begin{macrocode}
\newcommand*{\DTMenIEtimezonesep}{\space}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenIEdatesep}
% The separator for the numeric date format.
%    \begin{macrocode}
\newcommand*{\DTMenIEdatesep}{/}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\DTMenIEtimesep}
% The separator for the numeric time format.
%    \begin{macrocode}
\newcommand*{\DTMenIEtimesep}{:}
%    \end{macrocode}
%\end{macro}
%
%Provide keys that can be used in \cs{DTMlangsetup} to set these
%separators.
%    \begin{macrocode}
\DTMdefkey{en-IE}{daymonthsep}{\renewcommand*{\DTMenIEdaymonthsep}{#1}}
\DTMdefkey{en-IE}{monthyearsep}{\renewcommand*{\DTMenIEmonthyearsep}{#1}}
\DTMdefkey{en-IE}{datetimesep}{\renewcommand*{\DTMenIEdatetimesep}{#1}}
\DTMdefkey{en-IE}{timezonesep}{\renewcommand*{\DTMenIEtimezonesep}{#1}}
\DTMdefkey{en-IE}{datesep}{\renewcommand*{\DTMenIEdatesep}{#1}}
\DTMdefkey{en-IE}{timesep}{\renewcommand*{\DTMenIEtimesep}{#1}}
%    \end{macrocode}
%
% Define a boolean key that can switch between full and abbreviated
% formats for the month and day of week names in the text format.
%    \begin{macrocode}
\DTMdefboolkey{en-IE}{abbr}[true]{}
%    \end{macrocode}
% The default is the full name.
%    \begin{macrocode}
\DTMsetbool{en-IE}{abbr}{false}
%    \end{macrocode}
%
% Define a boolean key that determines if the time zone mappings
% should be used.
%    \begin{macrocode}
\DTMdefboolkey{en-IE}{mapzone}[true]{}
%    \end{macrocode}
% The default is to use mappings.
%    \begin{macrocode}
\DTMsetbool{en-IE}{mapzone}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% day of the month. (Called "showdayofmonth" instead of "showday" to
% avoid confusion with the day of the week.)
%    \begin{macrocode}
\DTMdefboolkey{en-IE}{showdayofmonth}[true]{}
%    \end{macrocode}
% The default is to show the day of the month.
%    \begin{macrocode}
\DTMsetbool{en-IE}{showdayofmonth}{true}
%    \end{macrocode}
%
% Define a boolean key that determines whether to show or hide the
% year.
%    \begin{macrocode}
\DTMdefboolkey{en-IE}{showyear}[true]{}
%    \end{macrocode}
% The default is to show the year.
%    \begin{macrocode}
\DTMsetbool{en-IE}{showyear}{true}
%    \end{macrocode}
%
%\begin{macro}{\DTMenIEfmtordsuffix}
% Define the ordinal suffix to be used by this style.
%    \begin{macrocode}
\newcommand*{\DTMenIEfmtordsuffix}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
% Define a setting to change the ordinal suffix style.
%    \begin{macrocode}
\DTMdefchoicekey{en-IE}{ord}[\val\nr]{level,raise,omit,sc}{%
 \ifcase\nr\relax
   \renewcommand*{\DTMenIEfmtordsuffix}[1]{##1}%
 \or
   \renewcommand*{\DTMenIEfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsuperscript{##1}}{##1}}%
 \or
   \renewcommand*{\DTMenIEfmtordsuffix}[1]{}%
 \or
   \renewcommand*{\DTMenIEfmtordsuffix}[1]{%
    \DTMtexorpdfstring{\protect\textsc{##1}}{##1}}%
 \fi
}
%    \end{macrocode}
%
% Define the "en-IE" style.
%    \begin{macrocode}
\DTMnewstyle
 {en-IE}% label
 {% date style
   \renewcommand*{\DTMenglishfmtordsuffix}{\DTMenIEfmtordsuffix}%
   \renewcommand*\DTMdisplaydate[4]{%
     \ifDTMshowdow
       \ifnum##4>-1%
        \DTMifbool{en-IE}{abbr}%
         {\DTMenglishshortweekdayname{##4}}%
         {\DTMenglishweekdayname{##4}}%
        \space
       \fi
     \fi
     \DTMifbool{en-IE}{showdayofmonth}%
     {%
       \DTMenglishordinal{##3}%
       \DTMenIEdaymonthsep
     }%
     {}%
     \DTMifbool{en-IE}{abbr}%
     {\DTMenglishshortmonthname{##2}}%
     {\DTMenglishmonthname{##2}}%
     \DTMifbool{en-IE}{showyear}%
     {%
       \DTMenIEmonthyearsep\number##1 % space intended
     }%
     {}%
   }%
   \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
   \renewcommand*\DTMenglishtimesep{\DTMenIEtimesep}%
   \DTMsettimestyle{englishampm}%
 }%
 {% zone style
   \DTMresetzones
   \DTMenIEzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-IE}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenIEtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenIEdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenIEtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }%
%    \end{macrocode}
%
% Define numeric style.
%    \begin{macrocode}
\DTMnewstyle
 {en-IE-numeric}% label
 {% date style
    \renewcommand*\DTMdisplaydate[4]{%
      \DTMifbool{en-IE}{showdayofmonth}%
      {%
        \number##3 % space intended
        \DTMenIEdatesep
      }%
      {}%
      \number##2 % space intended
      \DTMifbool{en-IE}{showyear}%
      {%
        \DTMenIEdatesep
        \number##1 % space intended
      }%
      {}%
    }%
    \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
 }%
 {% time style
    \renewcommand*\DTMdisplaytime[3]{%
      \number##1
      \DTMenIEtimesep\DTMtwodigits{##2}%
      \ifDTMshowseconds\DTMenIEtimesep\DTMtwodigits{##3}\fi
    }%
 }%
 {% zone style
   \DTMresetzones
   \DTMenIEzonemaps
   \renewcommand*{\DTMdisplayzone}[2]{%
     \DTMifbool{en-IE}{mapzone}%
     {\DTMusezonemapordefault{##1}{##2}}%
     {%
       \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
       \ifDTMshowzoneminutes\DTMenIEtimesep\DTMtwodigits{##2}\fi
     }%
   }%
 }%
 {% full style
   \renewcommand*{\DTMdisplay}[9]{%
    \ifDTMshowdate
     \DTMdisplaydate{##1}{##2}{##3}{##4}%
     \DTMenIEdatetimesep
    \fi
    \DTMdisplaytime{##5}{##6}{##7}%
    \ifDTMshowzone
     \DTMenIEtimezonesep
     \DTMdisplayzone{##8}{##9}%
    \fi
   }%
   \renewcommand*{\DTMDisplay}{\DTMdisplay}%
 }
%    \end{macrocode}
%
%\begin{macro}{\DTMenIEzonemaps}
% The time zone mappings are set through this command, which can be
% redefined if extra mappings are required or mappings need to be
% removed.
%    \begin{macrocode}
\newcommand*{\DTMenIEzonemaps}{%
  \DTMdefzonemap{00}{00}{GMT}%
  \DTMdefzonemap{01}{00}{IST}%
}
%    \end{macrocode}
%\end{macro}
%
% Switch style according to the \opt{useregional} setting.
%    \begin{macrocode}
\DTMifcaseregional
{}% do nothing
{\DTMsetstyle{en-IE}}%
{\DTMsetstyle{en-IE-numeric}}%
%    \end{macrocode}
%
% Redefine \cs{dateenglish} (or \cs{date}\meta{dialect}) to prevent
% \sty{babel} from resetting \cs{today}. (For this to work,
% \sty{babel} must already have been loaded if it's required.)
%    \begin{macrocode}
\ifcsundef{date\CurrentTrackedDialect}
{% do nothing
  \ifundef\dateenglish
  {%
  }%
  {%
    \def\dateenglish{%
      \DTMifcaseregional
      {}% do nothing
      {\DTMsetstyle{en-IE}}%
      {\DTMsetstyle{en-IE-numeric}}%
    }%
  }%
}%
{%
  \csdef{date\CurrentTrackedDialect}{%
    \DTMifcaseregional
    {}% do nothing
    {\DTMsetstyle{en-IE}}%
    {\DTMsetstyle{en-IE-regional}}%
  }%
}%
%    \end{macrocode}
%
%\iffalse
%    \begin{macrocode}
%</datetime2-en-IE.ldf>
%    \end{macrocode}
%\fi
%\Finale
\endinput
