是否可以对时间格式变量使用命令ceil,例如09:31:23?我想用ceil有09:32:00。我尝试使用类似于round(time,'0:01:00'T)的东西,但我想使用ceil,因为我不想舍入。使用round将为我提供09:31:00。我试着用ceil代替round,但它不起作用。
发布于 2012-07-05 06:16:56
由于SAS时间实际上是从午夜开始的秒数,CEIL将提供下一秒的开始。要获取下一分钟的开始时间,请使用INTNX函数。
data _null_;
t='09:31:23.12'T;
nextsecond=ceil(t);
nextminute=intnx('minute', t, 1, 'BEGINNING');
put t= time12.2 nextsecond= time12.2 nextminute= time12.2;
run;
LOG: t=9:31:23.12 nextsecond=9:31:24.00 nextminute=9:32:00.00https://stackoverflow.com/questions/11334954
复制相似问题