ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* date handling maltreated?
@ 2013-03-20 15:26 H. van der Meer
  2013-03-20 15:27 ` Meer H. van der
  2013-03-20 20:34 ` Hans Hagen
  0 siblings, 2 replies; 6+ messages in thread
From: H. van der Meer @ 2013-03-20 15:26 UTC (permalink / raw)
  To: ConTeXt NTG

Trying to do some date and time processing myself, I ran into problems caused by ConTeXt makeing it incompatibel with the original plain TeX itself!

In the TeX-book, Appendix B one finds
<citation>
(Some parameters are set by TeX itself as it runs, so it is inappropriate to initialize them: \time, \day, \month, and year are established at the beginning of a job; ..
</citation>

Now the results in ConTeXT with a minimal example, put into the log for easier copying into the mail:
\starttext
\writestatus{}{\meaning\date -> \date}
\writestatus{}{\meaning\day -> \the\day}
\writestatus{}{\meaning\month -> \month WHY NOT monthname?}
\writestatus{}{\meaning\year -> \the\year}
\writestatus{}{\meaning\time -> \the\time}
\stoptext

Result:
                > \time-> \time 
                > \protected macro:->\dodoubleempty \syst_converters_date -> \date 
                > \day-> 20
                > macro:#1->\ctxcommand {monthname(#1)}-> \labeltext {unknown}RROR
                > \year-> 2013
                > \time-> 982

I strongly ask that ConTeXt abstains from changing the definition of \month and reverts to the exact result as given by plain TeX, i.e. a number in the range [1-12]. Because the change makes it impossible to do calculations on the month.

Hans van der Meer



___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread
* date handling maltreated?
@ 2013-03-20 15:40 H. van der Meer
  2013-03-20 15:45 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: H. van der Meer @ 2013-03-20 15:40 UTC (permalink / raw)
  To: ConTeXt NTG


[-- Attachment #1.1: Type: text/plain, Size: 2101 bytes --]

Trying to do some date and time processing myself, I ran into problems caused by ConTeXt makeing it incompatibel with the original plain TeX itself!

In the TeX-book, Appendix B one finds
<citation>
(Some parameters are set by TeX itself as it runs, so it is inappropriate to initialize them: \time, \day, \month, and year are established at the beginning of a job; ..
</citation>

Now the results in ConTeXT with a minimal example, put into the log for easier copying into the mail:
\starttext
\writestatus{}{\meaning\date -> \date}
\writestatus{}{\meaning\day -> \the\day}
\writestatus{}{\meaning\month -> \month WHY NOT monthname?}
\writestatus{}{\meaning\year -> \the\year}
\writestatus{}{\meaning\time -> \the\time}
\stoptext

Result:
> \protected macro:->\dodoubleempty \syst_converters_date -> \date 
> \day-> 20
> macro:#1->\ctxcommand {monthname(#1)}-> \labeltext {unknown}HY NOT monthname?
> \year-> 2013
> \time-> 989

Plain TeX here gives:
\message{\meaning\day -> \the\day}
\message{\meaning\month -> \the\month}
\message{\meaning\year -> \the\year}
\message{\meaning\time -> \the\time}
\end

Result:
(./plaindates.tex \day-> 20 \month-> 3 \year-> 2013 \time-> 991 )

I strongly ask that ConTeXt abstains from changing the definition of \month and reverts to the exact result as given by plain TeX, i.e. a number in the range [1-12]. Because the change in ConTeXt makes it impossible to do calculations on the month.

Furthermore I encountered problems with defining expanded macros for currentdate and currenttime. This seems impossible to accomplish, at least in a simple manner. See the results from these to examples:
\edef\thedate{\currentdate}\writestatus{}{\meaning\thedate -> \thedate}
\edef\thetime{\currenttime}\writestatus{}{\meaning\thetime -> \thetime}
giving:
> macro:->\currentdate -> \currentdate 
> macro:->\currenttime -> \currenttime 

This is most unhappy, because one really should be able to put the expansions of these macros somewhere.
I hope the next beta will have solutions for these problems.

Hans van der Meer


[-- Attachment #1.2: Type: text/html, Size: 4897 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-20 20:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-20 15:26 date handling maltreated? H. van der Meer
2013-03-20 15:27 ` Meer H. van der
2013-03-20 20:34 ` Hans Hagen
2013-03-20 15:40 H. van der Meer
2013-03-20 15:45 ` Wolfgang Schuster
2013-03-20 16:26   ` Meer H. van der

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).