Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: mata stata() parameters


From   Phil Schumm <pschumm@uchicago.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: mata stata() parameters
Date   Wed, 22 Aug 2007 14:28:29 -0500

On Aug 22, 2007, at 2:14 PM, Sergiy Radyakin wrote:
I am working with Stata 9.2 and I need to get today's day, month and year.
<snip>

(I want the compiled [Mata] code to access current date, not the date when it was compiled).

: stata("version")
version 9.2

: printf("%d", date(st_global("c(current_date)"),"dmy"))
22aug2007
: day(date(st_global("c(current_date)"),"dmy"))
  22

: month(date(st_global("c(current_date)"),"dmy"))
  8

: year(date(st_global("c(current_date)"),"dmy"))
  2007


-- Phil

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index