summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/koma-script/doc/scrtime-en.tex
blob: baaae1bc9ce07e553b82a9112fedceedded8cc43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
% ======================================================================
% scrtime-en.tex
% Copyright (c) Markus Kohm, 2001-2022
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, version 1.3c of the license.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX 
% version 2005/12/01 or later and of this work.
%
% This work has the LPPL maintenance status "author-maintained".
%
% The Current Maintainer and author of this work is Markus Kohm.
%
% This work consists of all files listed in MANIFEST.md.
% ======================================================================
%
% Chapter about scrtime of the KOMA-Script guide
% Maintained by Markus Kohm
%
% ============================================================================

\KOMAProvidesFile{scrtime-en.tex}
                 [$Date: 2022-06-05 12:40:11 +0200 (So, 05. Jun 2022) $
                  KOMA-Script guide (chapter: scrtime)]
\translator{Markus Kohm\and Gernot Hassenpflug\and Karl Hagen}

\chapter{The Current Time with \Package{scrtime}}
\labelbase{scrtime}
\BeginIndexGroup
\BeginIndex{Package}{scrtime}

This package lets you find the current time. Starting with version~3.05, the
package also supports the option interface already familiar from the
\KOMAScript{} classes and various other \KOMAScript{} packages. See, for
example, \autoref{sec:typearea.options} for more information.

\begin{Declaration}%
  \Macro{thistime}\OParameter{delimiter}%
  \Macro{thistime*}\OParameter{delimiter}
\end{Declaration}%
\Macro{thistime} returns the current time\Index{time} in hours and minutes.
The delimiter between the values of hour, minutes and seconds can be given in
the optional argument. The default is the character ``\PValue{:}''.

\Macro{thistime*} works in almost the same way as \Macro{thistime}. The only
difference is that, unlike \Macro{thistime}, \Macro{thistime*} does not add a
leading zero to the minute field when its value is less than 10. Thus, with
\Macro{thistime} the minute field has always two places.
\begin{Example}
  The line
\begin{lstlisting}
  Your train departs at \thistime.
\end{lstlisting}
  results, for example, in:
  \begin{ShowOutput}
    Your train departs at \thistime.
  \end{ShowOutput}
  or:
  \begin{ShowOutput}
    Your train departs at 23:09.
  \end{ShowOutput}
  \bigskip
  In contrast to the previous example a line like:
\begin{lstlisting}
  This day is already \thistime*[\ hours and\ ] minutes old.
\end{lstlisting}
  results in:
  \begin{ShowOutput}
    This day is already \thistime*[\ hours and\ ] minutes old.
  \end{ShowOutput}
  or:
  \begin{ShowOutput}
    This day is already 12 hours and 25 minutes old.
  \end{ShowOutput}
\end{Example}
\EndIndexGroup


\begin{Declaration}%
 \Macro{settime}\Parameter{time}
\end{Declaration}%
\Macro{settime} sets the output of \DescRef{scrtime.cmd.thistime} and
\DescRef{scrtime.cmd.thistime*} to a fixed value. In this case, the optional
parameter of \DescRef{scrtime.cmd.thistime} or \DescRef{scrtime.cmd.thistime*}
is ignored, since the complete string returned by
\DescRef{scrtime.cmd.thistime} or \DescRef{scrtime.cmd.thistime*} has been
explicitly defined. \Macro{settime}.%
\EndIndexGroup


\begin{Declaration}
  \OptionVName{12h}{simple switch}%
\end{Declaration}%
\BeginIndex{Option}{24h}%
With the \Option{12h}\ChangedAt{v3.05a}{\Package{scrtime}} option, you can
select whether to print the time given by \DescRef{scrtime.cmd.thistime} and
\DescRef{scrtime.cmd.thistime*} in 12- or 24-hour format. The option accepts
the values for simple switches listed in \autoref{tab:truefalseswitch},
\autopageref{tab:truefalseswitch}. Using the option without a value is
equivalent to \OptionValue{12h}{true}, and therefore activates the
12-hour-format. The default, however, is \Option{24h}.

You can set this option globally in the optional argument of
\DescRef{typearea.cmd.documentclass}, as a package option in the optional
argument of \DescRef{typearea.cmd.usepackage}, or even after loading the
package using \DescRef{typearea.cmd.KOMAoptions} or
\DescRef{typearea.cmd.KOMAoption} (see, e.\,g. \autoref{sec:typearea.options},
\DescPageRef{typearea.cmd.KOMAoptions}). However the option no longer has any
effect on the if you call \DescRef{scrtime.cmd.settime}. After invoking this
command, the time is output only with the value and in the format specified
there.

For\textnote{Attention!} the sake of compatibility with earlier versions of
\Package{scrtime}, the option \Option{24h} will switch to 24-hour format if
used in the optional argument of \Macro{documentclass} or \Macro{usepackage}.
However, you should not use this option any longer.%
\EndIndexGroup
%
\EndIndexGroup

\endinput

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "scrguide-en.tex"
%%% coding: utf-8
%%% ispell-local-dictionary: "en_GB"
%%% eval: (flyspell-mode 1)
%%% End: