Nicholas J. Cox
This is an informal overview of several key points in dealing with date and time data in Stata. Dates and times in Stata are integers with specified units. Years are usually easy to handle. Otherwise, dates in Stata have origin at the beginning of 1960. Date or time inputs often need translation to Stata dates or times. Conversion from one kind of date or time to another requires a special function, as does extraction of date or time components. Weeks are different. Assigning date or date-time display formats is essential to understand your variables. Once your dates and times are set up, consider tsset or xtset. I also explain how month names or abbreviations may be mapped to integers 1 to 12 and how fraction of year may be calculated, which is useful for fitting sinusoids.