![]() |
From | Nick Winter <nwinter@virginia.edu> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: minor annoyance |
Date | Thu, 07 Aug 2008 14:28:53 -0400 |
Jeph,
If you frequently need today's date formatted as a Stata date value or some other specific format like the one below, you might find it convenient to make a global macro like $today in your profile.do file.
The risk would be that if you leave your computer (and Stata) on overnight, the macro would refer to an earlier date.
David
At 8:58 AM -0400 8/7/08, Jeph Herrin wrote:
Even if one isn't using it to compare with a date variable, one usually wants to reformat before using, and converting to a date value is the easiest way to proceed, eg, local today=string(date("`c(current_date)'","DMY"),"%tdCCYY.NN.DD")
-- -------------------------------------------------------------- Nicholas Winter 434.924.6994 t Assistant Professor 434.924.3359 f Department of Politics nwinter@virginia.edu e University of Virginia faculty.virginia.edu/nwinter w PO Box 400787, 100 Cabell Hall Charlottesville, VA 22904 * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/
© Copyright 1996–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |