Statalist


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

st: RE: minor annoyance


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: minor annoyance
Date   Thu, 7 Aug 2008 17:54:43 +0100

As before your question has two aspects. On why it is done this way, I
guess it was to be compatible with $S_DATE, which was introduced into
Stata way back. I think the main 
purpose of that was to provide a date stamp that users could put in
their logs, which is why it shows e.g. 7 August 2008, not 17751. 

I can easily see why you might want the numeric date (say as
c(current_Stata_date)) but equally why StataCorp might take the view
that you need only one step to get where you want to be. 

The trouble is that these individual requests look painless, but you
could probably bloat the c-class results by a fair factor by allowing
many such equally justifiable small tweaks. 

Nick
[email protected] 

Jeph Herrin

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:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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