Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Setting today's date in a do-file


From   [email protected] (William Gould, Stata)
To   [email protected]
Subject   Re: st: Setting today's date in a do-file
Date   Tue, 21 Nov 2006 08:27:00 -0600

Patrick Woodburn <[email protected]> has a do-file that 
contains the line 


        global today "d(21nov2006)"

but he has to remember to change the line each time he runs the file.  "Is
there any way to automatically obtain today's date?", he asks.

Change the line to read 

        global today "d(`c(current_date)')"

`c(current_date)' is today's date in string form, i.e., "21 Nov 2006".

-cret list- will list the other commonly requested things Stata has
available for you.  See -help creturn- for more details.

-- Bill
[email protected]
*
*   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