Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: how to show date on a graph title by citing the date local


From   Guang Dai <Guang.Dai@albertamsa.ca>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: how to show date on a graph title by citing the date local
Date   Fri, 4 Nov 2011 09:58:56 -0600

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of James Sams
Sent: Friday, November 04, 2011 9:48 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: how to show date on a graph title by citing the date local

On Friday, November 04, 2011, you wrote:
> dear all,
> I have one question on displaying the desired format of date in the 
> citation case.
> for example, to show the date of a tiem variable we can  use format 
> %td  varname.
> However, how to this if I want  show the date in a citation, say in 
> the title of a graph. I tried  title(" From dofc(`date1_local') to 
> dofc(`date2_local') ") but this obviously failed. any suggestions?

Look at stata's extended functions, specifically display. For a day stored in a local macro `date'

local formatted_date : display %td `date'

You could just reassign to date as well.

http://www.stata.com/help.cgi?extended_fcn

--
James Sams
sams.james@gmail.com

*
*   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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index