[comp.text] Time of Day in troff

duc@cos.com (Duc Kim Nguyen) (04/09/89)

I have two questions:

(1) troff: how do I get time of day ?  Similar to to get date from
    troff, number registers dy, mo and yr, is there some thing like
    hr, mi, se (for hour, minute, second) ?

(2) LaTeX: how do I get tabular environment to produce carry-over
    header like .TH in troff (for ms and mm macros) ?

Thanks

duc@COS.COM
==
Duc Kim Nguyen			* duc@cos.com 
Corporation for Open Systems	* duc%cos.com@uunet.uu.net
1750 Old Meadow Rd, Suite 400	* ...!{uunet,sundc,hadron,hqda-ai,decuac}!cos!duc
McLean, VA 22102-4306		* phone: (703) 883-2792
DISCLAIMER: Views expressed here are my own, NOT my employer's.

kg@elan.UUCP (Ken Greer) (04/10/89)

From article <16810@cos.com>, by duc@cos.com (Duc Kim Nguyen):
> 
> (1) troff: how do I get time of day ?  Similar to to get date from
>     troff, number registers dy, mo and yr, is there some thing like
>     hr, mi, se (for hour, minute, second) ?

Try this!

	.sy /bin/date +".nr hr %H%n.nr mi %M%n.nr se %S" > /tmp/date\n($$
	.so /tmp/date\n($$
	.sy rm -f /tmp/date\n($$

Ken Greer
Elan Computer Group, Inc.
{ames,uunet}!elan!kg
415-964-2200

daved@physiol.su.oz (Dave Davey) (04/11/89)

In article <512@elan.UUCP>, kg@elan.UUCP (Ken Greer) writes:
> From article <16810@cos.com>, by duc@cos.com (Duc Kim Nguyen):
> > 
> > (1) troff: how do I get time of day ?  Similar to to get date from
> Try this!
> 
> 	.sy /bin/date +".nr hr %H%n.nr mi %M%n.nr se %S" > /tmp/date\n($$
> 	.so /tmp/date\n($$
> 	.sy rm -f /tmp/date\n($$

This will only work if your date program accepts the format argument,
and will not be the case for most standard /bin/date programs.  You might look
for fdate.