Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix writing dates/times to dta #145
Writing dates and datetimes to dta is currently broken (#139), since haven does not convert them to the Stata epoch (1960-01-01). This pull request fixes that.
Instead of adding more conditionals to write_sav, I opted to create separate write_dta and write_sav methods. I feel that this makes it easier for me and others who are only familiar with one of the formats to contribute. I also expect the two functions to diverge further when #143 is fixed. Perhaps it would make sense at some point in the future to have separate classes for each of the formats inheriting from DfWriter.
My main concern with this approach is that it does lead to a lot of duplicated code, but I think you're right that this is inevitable as the sav and dta writes will continues to diverge overtime.
Could you please complete the split by removing the