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: Fwd: changing the format of the current date


From   "William Gould, StataCorp LP" <wgould@stata.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Fwd: changing the format of the current date
Date   Wed, 22 May 2013 14:10:38 -0500

Melanie Leis <melanieleis@gmail.com> wrote, 

> Is there a way to change the format of the automated date in
> c(current_date)?
> 
> The automatic format is 22 May 2013
> 
> I would like to get something that looks like 2013 05 22


There's already been one good answer.  Here's another, 

        . display %td_CCYY_NN_DD date(c(current_date), "DMY") 
        2013 05 22


-- Bill
wgould@stata.com
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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