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

st: minor annoyance

From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   st: minor annoyance
Date   Thu, 07 Aug 2008 08:58:45 -0400

Is there any reason that -c(current_date)- can't
return the date as a Stata date value?

Even if one isn't using it to compare with a date
variable, one usually wants to reformat before using,
and converting to a date value is the easiest way
to proceed, eg,

local today=string(date("`c(current_date)'","DMY"),"%tdCCYY.NN.DD")

Just one line of code, but still a minor nusiance to
convert each time, and doubly so because one is converting
a Stata-supplied value to Stata-preferred format.

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index