Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Comment on date formats: Re: statalist-digest V4 #3271


From   "Allan Reese (Cefas)" <[email protected]>
To   <[email protected]>
Subject   st: Comment on date formats: Re: statalist-digest V4 #3271
Date   Thu, 11 Dec 2008 11:01:55 -0000

Moving dates between programs is always problematical.  Both the
software and each user have to act on assumptions.  IMO the only safe
method is to split the date into day, month and year fields.  For data
entry I recommend using month names, then there's no confusion that 9/11
might have happened in November.  I've just written such code using a
pull-down list of month names, converting to the month number by the
equivalent of

gen nmonth = (strpos("JanFebMarAprMayJunJulAugSepOctNovDec", month)+2)/3

Has anyone seen problems of dates confused between AD and AH or other
calendars?

Allan  
-------------------------------------
Date: Wed, 10 Dec 2008 08:27:19 -0500
From: Jeph Herrin <[email protected]>
Subject: Re: st: Date format export to excel

Excel is reading the mon/year as mon/day and then adding
the current year.

So Nov 08 -> 11/08 -> 11/08/2008
    Sep 01 ->  9/01 ->  9/01/2008

Which explains what you are seeing, but not how to fix it.

I have often run into similar problems with Excel, and how
it handles dates differs not only with version of Excel but
also how some of the defaults are set - dates that look fine
when I open them in Excel are completely wrong when someone
else opens the same file in Excel.


***********************************************************************************
This email and any attachments are intended for the named recipient only.  Its unauthorised use, distribution, disclosure, storage or copying is not permitted.  If you have received it in error, please destroy all copies and notify the sender.  In messages of a non-business nature, the views and opinions expressed are the author's own and do not necessarily reflect those of the organisation from which it is sent.  All emails may be subject to monitoring.
***********************************************************************************


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index