Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65555

-todate- generates a Post-Classical date in year 206, from an observation in year 2006

$
0
0
Hello, I'm using -todate- to convert string dates (yyyymmdd) to Stata dates.
The following reproducible code generates a date of "12 May 206", which is puzzling given that the original string date (20060511) specifies year 2006.
HTML Code:
clear
set obs 2
input date
20060511  
20131213 
destring date, replace 
format date %10.0g
todate date, gen(new_date) p(yyyymmdd) f(%dd_m_cy)
l
This happens whether or not I use the -destring- command. I'd very much appreciate any feedback or advice.


Viewing all articles
Browse latest Browse all 65555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>