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 (William Gould, Stata)
Subject   Re: st: Setting today's date in a do-file
Date   Tue, 21 Nov 2006 08:27:00 -0600

Patrick Woodburn <> 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
*   For searches and help try:

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