Stata System Parameters

Stata exposes its configuration and internal parameters by the c() class.


Access

Use creturn list to view all c() class variables.


Usage

Create Date Stamp

Use c(current_date). which is the date as "dd MMM yyyy".

local ts = string(td(`c(current_date)'), "%tdCYND")

Create Datetime Stamp

Use c(current_time), which is the time as "hh:mm:ss", in addition to c(current_date) as shown above.

local ts = string(td(`c(current_date)'), "%tdCYND") + "_" + string(tc(`c(current_time)'), "%tcHM")


CategoryRicottone