| 1 |
% ====================================================================== |
| 2 |
% scrtime-en.tex |
| 3 |
% Copyright (c) Markus Kohm, 2001-2022 |
| 4 |
% |
| 5 |
% This file is part of the LaTeX2e KOMA-Script bundle. |
| 6 |
% |
| 7 |
% This work may be distributed and/or modified under the conditions of |
| 8 |
% the LaTeX Project Public License, version 1.3c of the license. |
| 9 |
% The latest version of this license is in |
| 10 |
% http://www.latex-project.org/lppl.txt |
| 11 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 12 |
% version 2005/12/01 or later and of this work. |
| 13 |
% |
| 14 |
% This work has the LPPL maintenance status "author-maintained". |
| 15 |
% |
| 16 |
% The Current Maintainer and author of this work is Markus Kohm. |
| 17 |
% |
| 18 |
% This work consists of all files listed in MANIFEST.md. |
| 19 |
% ====================================================================== |
| 20 |
% |
| 21 |
% Chapter about scrtime of the KOMA-Script guide |
| 22 |
% Maintained by Markus Kohm |
| 23 |
% |
| 24 |
% ============================================================================ |
| 25 |
|
| 26 |
\KOMAProvidesFile{scrtime-en.tex} |
| 27 |
[$Date: 2022-06-05 12:40:11 +0200 (So, 05. Jun 2022) $ |
| 28 |
KOMA-Script guide (chapter: scrtime)] |
| 29 |
\translator{Markus Kohm\and Gernot Hassenpflug\and Karl Hagen} |
| 30 |
|
| 31 |
\chapter{The Current Time with \Package{scrtime}} |
| 32 |
\labelbase{scrtime} |
| 33 |
\BeginIndexGroup |
| 34 |
\BeginIndex{Package}{scrtime} |
| 35 |
|
| 36 |
This package lets you find the current time. Starting with version~3.05, the |
| 37 |
package also supports the option interface already familiar from the |
| 38 |
\KOMAScript{} classes and various other \KOMAScript{} packages. See, for |
| 39 |
example, \autoref{sec:typearea.options} for more information. |
| 40 |
|
| 41 |
\begin{Declaration}% |
| 42 |
\Macro{thistime}\OParameter{delimiter}% |
| 43 |
\Macro{thistime*}\OParameter{delimiter} |
| 44 |
\end{Declaration}% |
| 45 |
\Macro{thistime} returns the current time\Index{time} in hours and minutes. |
| 46 |
The delimiter between the values of hour, minutes and seconds can be given in |
| 47 |
the optional argument. The default is the character ``\PValue{:}''. |
| 48 |
|
| 49 |
\Macro{thistime*} works in almost the same way as \Macro{thistime}. The only |
| 50 |
difference is that, unlike \Macro{thistime}, \Macro{thistime*} does not add a |
| 51 |
leading zero to the minute field when its value is less than 10. Thus, with |
| 52 |
\Macro{thistime} the minute field has always two places. |
| 53 |
\begin{Example} |
| 54 |
The line |
| 55 |
\begin{lstlisting} |
| 56 |
Your train departs at \thistime. |
| 57 |
\end{lstlisting} |
| 58 |
results, for example, in: |
| 59 |
\begin{ShowOutput} |
| 60 |
Your train departs at \thistime. |
| 61 |
\end{ShowOutput} |
| 62 |
or: |
| 63 |
\begin{ShowOutput} |
| 64 |
Your train departs at 23:09. |
| 65 |
\end{ShowOutput} |
| 66 |
\bigskip |
| 67 |
In contrast to the previous example a line like: |
| 68 |
\begin{lstlisting} |
| 69 |
This day is already \thistime*[\ hours and\ ] minutes old. |
| 70 |
\end{lstlisting} |
| 71 |
results in: |
| 72 |
\begin{ShowOutput} |
| 73 |
This day is already \thistime*[\ hours and\ ] minutes old. |
| 74 |
\end{ShowOutput} |
| 75 |
or: |
| 76 |
\begin{ShowOutput} |
| 77 |
This day is already 12 hours and 25 minutes old. |
| 78 |
\end{ShowOutput} |
| 79 |
\end{Example} |
| 80 |
\EndIndexGroup |
| 81 |
|
| 82 |
|
| 83 |
\begin{Declaration}% |
| 84 |
\Macro{settime}\Parameter{time} |
| 85 |
\end{Declaration}% |
| 86 |
\Macro{settime} sets the output of \DescRef{scrtime.cmd.thistime} and |
| 87 |
\DescRef{scrtime.cmd.thistime*} to a fixed value. In this case, the optional |
| 88 |
parameter of \DescRef{scrtime.cmd.thistime} or \DescRef{scrtime.cmd.thistime*} |
| 89 |
is ignored, since the complete string returned by |
| 90 |
\DescRef{scrtime.cmd.thistime} or \DescRef{scrtime.cmd.thistime*} has been |
| 91 |
explicitly defined. \Macro{settime}.% |
| 92 |
\EndIndexGroup |
| 93 |
|
| 94 |
|
| 95 |
\begin{Declaration} |
| 96 |
\OptionVName{12h}{simple switch}% |
| 97 |
\end{Declaration}% |
| 98 |
\BeginIndex{Option}{24h}% |
| 99 |
With the \Option{12h}\ChangedAt{v3.05a}{\Package{scrtime}} option, you can |
| 100 |
select whether to print the time given by \DescRef{scrtime.cmd.thistime} and |
| 101 |
\DescRef{scrtime.cmd.thistime*} in 12- or 24-hour format. The option accepts |
| 102 |
the values for simple switches listed in \autoref{tab:truefalseswitch}, |
| 103 |
\autopageref{tab:truefalseswitch}. Using the option without a value is |
| 104 |
equivalent to \OptionValue{12h}{true}, and therefore activates the |
| 105 |
12-hour-format. The default, however, is \Option{24h}. |
| 106 |
|
| 107 |
You can set this option globally in the optional argument of |
| 108 |
\DescRef{typearea.cmd.documentclass}, as a package option in the optional |
| 109 |
argument of \DescRef{typearea.cmd.usepackage}, or even after loading the |
| 110 |
package using \DescRef{typearea.cmd.KOMAoptions} or |
| 111 |
\DescRef{typearea.cmd.KOMAoption} (see, e.\,g. \autoref{sec:typearea.options}, |
| 112 |
\DescPageRef{typearea.cmd.KOMAoptions}). However the option no longer has any |
| 113 |
effect on the if you call \DescRef{scrtime.cmd.settime}. After invoking this |
| 114 |
command, the time is output only with the value and in the format specified |
| 115 |
there. |
| 116 |
|
| 117 |
For\textnote{Attention!} the sake of compatibility with earlier versions of |
| 118 |
\Package{scrtime}, the option \Option{24h} will switch to 24-hour format if |
| 119 |
used in the optional argument of \Macro{documentclass} or \Macro{usepackage}. |
| 120 |
However, you should not use this option any longer.% |
| 121 |
\EndIndexGroup |
| 122 |
% |
| 123 |
\EndIndexGroup |
| 124 |
|
| 125 |
\endinput |
| 126 |
|
| 127 |
%%% Local Variables: |
| 128 |
%%% mode: latex |
| 129 |
%%% TeX-master: "scrguide-en.tex" |
| 130 |
%%% coding: utf-8 |
| 131 |
%%% ispell-local-dictionary: "en_GB" |
| 132 |
%%% eval: (flyspell-mode 1) |
| 133 |
%%% End: |