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 on April 23, 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   James Sams <sams.james@gmail.com>
To   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 10:48:01 -0500

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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index