20% off Stata Gift Shop purchases through 16 December. Use code GIFT20.
Updates to time/date variables were introduced in Stata 10.
Stata already had date variables; now it has time variables (and time-and-date variables, too). Time is recorded with up to millisecond resolution, which will be important for some. Also, Stata’s time variables will work with or without leap-second adjustment. You may never have heard about leap seconds, but there are clocks that are adjusted for them, and clocks that are not, and in computer-generated datasets, time stamps come both ways. Stata can work with either one.
You can now record values like 25jun2007, or 13:42:41.106, or 25jun2007 13:42:41.106.
Stata 10 has functions that make it easy to input date, time, and date-time variables, so you can read data recorded as June 25, 2007 1:42 p.m., or 6/25/07 13:42, or 250620071342106, or Mon Jun 25 13:42:41 CDT 2007.
Stata 10 has formats that let you display date, time, and date-time variables any way you want, including any of the above, and lots more.
To see more details, click here.
Classroom and web training
Teaching with Stata
Statalist: The Stata Forum
Last updated: 16 November 2022
StataCorp LLC (StataCorp) strives to provide our users with exceptional products and services. To do so, we must collect personal information from you. This information is necessary to conduct business with our existing and potential customers. We collect and use this information only where we may legally do so. This policy explains what personal information we collect, how we use it, and what rights you have to that information.
These cookies are essential for our website to function and do not store any personally identifiable information. These cookies cannot be disabled.
Please note: Clearing your browser cookies at any time will undo preferences saved here. The option selected here will apply only to the device you are currently using.