紧急求助各路大神!!
input x y z p
1960 1 1 0
1960 2 1 0
1960 3 1 0
1960 4 1 0
1960 5 1 0
1960 6 1 0
1960 7 1 0
1960 8 1 0
1960 9 1 0
1960 10 1 0
1960 11 1 0
1960 12 1 0
end
tostring x,replace
tostring y,replace
tostring z ,replace
tostring p, replace
gen date=x+"-"+y+"-"+z+" "+p
gen time=clock(date,"YMDh")
format time %tc
结果就成了这样
x y z p date time
1960 1 1 0 1960-1-1 0 01jan1960 00:00:00
1960 2 1 0 1960-2-1 0 01feb1960 00:00:00
1960 3 1 0 1960-3-1 0 01mar1960 00:00:00
1960 4 1 0 1960-4-1 0 01apr1960 00:00:00
1960 5 1 0 1960-5-1 0 01may1960 00:00:00
1960 6 1 0 1960-6-1 0 01jun1960 00:00:00
1960 7 1 0 1960-7-1 0 01jul1960 00:00:00
1960 8 1 0 1960-8-1 0 01aug1960 00:00:01
1960 9 1 0 1960-9-1 0 01sep1960 00:00:00
1960 10 1 0 1960-10-1 0 01oct1960 00:00:00
1960 11 1 0 1960-11-1 0 01nov1960 00:00:01
1960 12 1 0 1960-12-1 0 30nov1960 23:59:58
为什么用clock函数不能准确转化时间呢?