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   wgould@stata.com (William Gould, Stata)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Setting today's date in a do-file
Date   Tue, 21 Nov 2006 08:27:00 -0600

Patrick Woodburn <patrick.woodburn@mrcuganda.org> 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
wgould@stata.com
*
*   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–2023 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index