📄 tfcn.hlp
字号:
{smcl}
{* 07apr2005}{...}
{cmd:help tfcn}
{hline}
{title:Title}
{pstd}
{hi:[U] 24.3.2 Specifying particular dates (date literals)}
{title:Syntax}
{p 8 24 2}{it:...} {cmd:d(}{it:constant}{cmd:)} {it:...} {space 4} returns {cmd:%td} date{p_end}
{p 8 24 2}{it:...} {cmd:w(}{it:constant}{cmd:)} {it:...} {space 4} returns {cmd:%tw} date{p_end}
{p 8 24 2}{it:...} {cmd:m(}{it:constant}{cmd:)} {it:...} {space 4} returns {cmd:%tm} date{p_end}
{p 8 24 2}{it:...} {cmd:q(}{it:constant}{cmd:)} {it:...} {space 4} returns {cmd:%tq} date{p_end}
{p 8 24 2}{it:...} {cmd:h(}{it:constant}{cmd:)} {it:...} {space 4} returns {cmd:%th} date{p_end}
{p 8 24 2}{it:...} {cmd:y(}{it:constant}{cmd:)} {it:...} {space 4} returns {cmd:%ty} date{p_end}
Function description:
{p 4 25 2}Argument:{space 2}{cmd:d()}:{space 2}a day followed by a month followed by a 4-digit year{p_end}
{p 15 25 2}{cmd:w()}:{space 2}a 4-digit year followed by a week number, 1-52.{p_end}
{p 15 25 2}{cmd:m()}:{space 2}a 4-digit year followed by a month number, 1-12.{p_end}
{p 15 25 2}{cmd:q()}:{space 2}a 4-digit year followed by a quarter number, 1-4.{p_end}
{p 15 25 2}{cmd:h()}:{space 2}a 4-digit year followed by a half number, 1 or 2.{p_end}
{p 15 25 2}{cmd:y()}:{space 2}a 4-digit year{p_end}
{pstd}Returns:{space 3}as shown above
{p 4 11 2}Note: When typing one number followed by another, you must
place some separator between them, which may be comma, colon, dash, or even
a word or phrase. That is, you cannot type {cmd:w(1999 5)}; you may type
{cmd:w(1995w5)} or {cmd:w(1995 w 5)} or {cmd:w(1995 week number 5)}.
{p 4 11 2}Note: The {cmd:y()} function is often omitted since, for instance,
{cmd:y(1980)}==1980. However, {cmd:y()} does verify the argument has the
interpretation of a 4-digit year; {cmd:y(80)} is an error.
{pstd}
See {help tdates} for an explanation of {cmd:%t} time-series dates.
See {help tfmt} for an explanation of time-series formats.
{title:Examples}
{phang2}{cmd:. regress} {it:...} {cmd:if hdate > d(1mar1998)}
{pstd}
All of the following are equivalent
{phang2}{cmd:. tabulate} {it:...} {cmd:if bdate > d(15 january 1980)}{p_end}
{phang2}{cmd:. tabulate} {it:...} {cmd:if bdate > d(15january1980)}{p_end}
{phang2}{cmd:. tabulate} {it:...} {cmd:if bdate > d(15jan1980)}{p_end}
{phang2}{cmd:. tabulate} {it:...} {cmd:if bdate > d(15Jan1980)}{p_end}
{phang2}{cmd:. tabulate} {it:...} {cmd:if bdate > d(15/1/1980)}{p_end}
{phang2}{cmd:. tabulate} {it:...} {cmd:if bdate > d(15,1,1980)}
...
{pstd}
but typing {cmd:tabulate} {it:...} {cmd:if bdate > d(15 1 1980)} would be
an error.
{phang2}{cmd:. logistic} {it:...} {cmd:if qdate > q(1990-2)}
{phang2}{cmd:. count} {it:...} {cmd:if wdate < q(1990.1)}
{title:Also see}
{psee}
Manual: {bf:[D] functions},{break}
{bf:[U] 24 Dealing with dates},{break}
{bf:[U] 24.3.2 Specifying particular dates (date literals)}
{psee}
Online: {help tdates},
{help tfmt};
{help dates},
{help dfcn},
{helpb format},
{help functions},
{help mdyfcn}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -