International format date conversions (STB-19: dm17) ------------------------------------- ^idatetof^ idatevar [^if^ exp] [^in^ range]^, g^enerate^(^fvar^)^ ^ftoidate^ fvar [^if^ exp] [^in^ range]^, g^enerate^(^idatevar^)^ where: fvar variable containing formatted date (e.g., ^890131^) idatevar string variable containing dd/mm/yy (e.g., ^31/5/90^) Description ----------- These commands convert dates to and from numeric dates of the form yymmdd (fvar) and strings of the form dd/mm/yy (idatevar). In both commands the ^generate()^ "option" is not optional. Note that ^idatevar^ is the form used for dates as strings in many parts of the world outside the United States. That is, the day of the month ^precedes^ the month. The "i" is meant to signify "international". The two commands ^idatetof^ and ^ftoidate^ are the more international forms of Stata's original ^datetof^ and ^ftodate^. As an example consider the date October 31, 1992. In the United States this could be written as the string ^datevar^ 10/31/92, but outside the US this would be a nonsense: there is no 31st month. The correct string would be the ^idatevar^ 31/10/92. Examples -------- ^. ftoidate numdate, generate(strdate)^ ^. idatetof strdate, generate(numdate)^ Author ------ Philip Ryan Department of Community Medicine The University of Adelaide FAX (011)-61-8-223-4075 Also see -------- STB: dm17 (STB-19) Manual: [4] strings, [5d] dates On-line: help for ^datetof^, ^ftodate^