[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Current date and time listed in output
Robert A. Yaffee, Ph.D.
Shirley M. Ehrenkranz
School of Social Work
New York University
2100 Linwood Ave.
Fort Lee, NJ
----- Original Message -----
From: Phil Schumm <email@example.com>
Date: Saturday, May 27, 2006 10:26 pm
Subject: Re: st: Current date and time listed in output
> On May 27, 2006, at 8:41 PM, Robert A Yaffee wrote:
> > Does anyone know how I can get the current date and time to be
> > reported in the output of an rclass program that one has written?
> > What is the function for reporting the current date and time at
> > which the program was run on Stata?
> I'm not sure exactly what you're asking for. If you are writing a
> program and want to display and/or return the time at which the
> program is executed, you can use the following:
> program foo, rclass
> return local datetime = "`c(current_date)' `c(current_time)'"
> di as text return(datetime)
> // rest of program
> which produces
> . foo
> 27 May 2006 21:24:26
> . ret li
> r(datetime) : "27 May 2006 21:24:26"
> -- Phil
> * 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/
* For searches and help try: