Is there a way to reference "today"'s date in Stata, where "today" is the
current day based either on the computer's clock or some Stata clock?
The reason why I wonder this is that I frequently run a code that saves its
log in a log folder, and I would like to have each log file called
differently to automatically keep previous logs. It would be nice to be able
to replace the statement:
log using "`path'\logs\programlog.smcl", replace
with:
log using "`path'\logs\progamlog [today].smcl", replace
where [today] would be a function that returns today's date so that it
becomes part of the log's file name.
Other suggestions that achieve the same purpose are also welcome.
Thanks in advance for any help.
Mart�n Rio
Charles River Associates
Washington, DC
phone: (202) 662-3957
fax: (202) 662-3910
[...]
What you asked about is the S_DATE global macro. Thus, you might do this: