Don't use destring command. Just work on the original string variable like the following.
gen date_new=date(oldstringvariable, "YMD")
format date_new %tdNN/DD/CCYY
list oldstringvariable date_new in 1/15 //to check
|
楼主: hanyuning
|
22905
14
[数据管理求助] 求问:stata中数值型数据如何转化为指定格式的日期型数据 |
|
已卖:1798份资源 学科带头人 43%
-
|
50论坛币
最佳答案Don't use destring command. Just work on the original string variable like the following.
gen date_new=date(oldstringvariable, "YMD")
format date_new %tdNN/DD/CCYY
list oldstringvariable date_new in 1/15 //to check
| |
|
|
| ||||||||||||||
| ||
|
| |
| ||
| ||
加好友,备注jltj京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


