![]() |
From | Kit Baum <baum@bc.edu> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: Re: converting dates from Excel .csv file |
Date | Fri, 29 Aug 2008 06:49:34 -0400 |
Another trick with Excel dates (assuming you have the software) is to
open the sheet in Excel and apply a general or numeric format to the
date column. This will show you that (at least for dates subsequent to
1/1/1900) Excel uses elapsed days as well*. All you need to do is
subtract Stata's Day 0 in Excel's number line, 21916 (1/1/1960) from the
Excel elapsed day and you'll get a number that, once imported into
Stata, can be formatted to show the correct date.
E.G.: Date = Aug 28th, 1963
Excel numeric equivalent: 23251 - 21916 = Stata's elapsed day 1335
. di %dM_d,_CY 1335
August 28, 1963
* * 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–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |