Code: Select all
\usepackage{datetime}
\ClassWarning{}{Processing File... \today \currenttime}%
\typeout{Processing File... \today \currenttime}%
\newcommand*{\bkdatemsg}{Today is \today}%
\typeout{\bkdatemsg}%
\typeout{\today}%
Code: Select all
\usepackage{datetime}
\ClassWarning{}{Processing File... \today \currenttime}%
\typeout{Processing File... \today \currenttime}%
\newcommand*{\bkdatemsg}{Today is \today}%
\typeout{\bkdatemsg}%
\typeout{\today}%
NEW: TikZ book now 40% off at Amazon.com for a short time.
\today
and \currenttime
need to be (fully) expanded first. However, as I tried to get a solution expanding them before I got errors. It seems they're not expandable.expl3
(which provides easy expansion control). You would need a rather new version of the l3kernel, I guess. I'm not sure since when \iow_log:n
is provided.Code: Select all
\documentclass{article}
\usepackage{expl3}
\ExplSyntaxOn
% save original \today since the new one is not expandable:
\cs_set_eq:NN \lgt_file_date: \today
\usepackage{datetime}
% avoid \currenttime since it's not expandable:
\cs_new_nopar:Npn \lgt_file_time:
{
\lgt_get_time:N \currenthour :
\lgt_get_time:N \currentminute :
\lgt_get_time:N \currentsecond
}
% add leading 0 if necessary:
\cs_new_nopar:Npn \lgt_get_time:N #1
{
\int_compare:nNnT { #1 } < { 10 } { 0 }
\int_use:N #1
}
% write to log file (argument is expanded first):
\iow_log:x
{ Processing~File... ~ \lgt_file_date: \tl_use:N \c_space_tl \lgt_file_time: }
% give a message:
% \ClassWarning { }
% { Processing~File... ~ \lgt_file_date: \tl_use:N \c_space_tl \lgt_file_time: }
\ExplSyntaxOff
\begin{document}
bla
\end{document}
NEW: TikZ book now 40% off at Amazon.com for a short time.