Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: dhms time format


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: dhms time format
Date   Wed, 28 Jul 2004 10:57:33 +0100

-egenmore- is a user-written package on SSC. 
I'm not aware that anyone's written a manual
on it; presumably you mean the on-line help. 

In the case of the -egen- function -dhms()-, 
which was written by Kit Baum, 
its -format()- option is just a way of calling up 
the -format- command and using whatever 
format you want, so long as it is officially 
supported. 

Your question is thus for StataCorp, who 
don't support the kind of formats you want. 
For display, you do need string variables, 
and this is exactly what the functions 
in -egenmore- try to provide -- although 
it may well be that they were written 
ad hoc as user-programmers wanted them, 
and no one's claiming they're a complete set. 

There are undoubtedly many users who want such 
support for time of day stuff. I guess
the issue is not supporting formats, 
but a deeper issue of appropriate data 
types for holding dates and times 
even to the precision of seconds. 
It might need a -longlong- data type (say) 
to be compatible with Stata dates, 
but that's pure surmise on my part. 

Nick 
[email protected] 

Douglas Crawford
> 
> The egenmore manual suggests that I can format the result of dhms:
> 
> dhms(d h m s) [ ,  format(format)  ]
> 
> but the %t formats available do not seem to permit units 
> smaller than a day
> (with an emphasis on larger units such as quarter).  Ideally 
> I would like to
> display any of the following:
> 	
> 	date:hh:mm
> 	d:hh:mm
> 	hh:mm
> 	hh:mm:ss
> 
> I don't want to generate a string, just display the results 
> of dhms in an
> attractive a manner as the date formats.  The list archive 
> suggests that
> this is a wish-list item, but I am hoping I missed something.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index