简体   繁体   English

如何在 RPG-Free 中获得 6 位数字时间?

[英]How to get 6 Digit Numeric Time in RPG-Free?

I am trying to get the system time from my iSeries in a 6 digit numeric format.我正在尝试以 6 位数字格式从 iSeries 获取系统时间。 The time would be in a HHMMSS format.时间将采用HHMMSS格式。

I have tried using:我试过使用:

CDBRVWTM = %Dec(%Time(): *ISO); 

and

CDBRVWTM = %DEC(%CHAR(%TIME()):6:0); 

The field CDBRVWTM is a 6 digit numeric field in the table.字段 CDBRVWTM 是表中的 6 位数字字段。

**free
ctl-opt main(mainline);


dcl-proc mainline;

   dcl-s CurTime packed(6:0);

   curTime = %dec(%time():*HMS);
   dsply %char(curTime);

   return;

end-proc;

Matt, what problem did you have with %Dec(%Time(): *ISO)?马特,你对 %Dec(%Time(): *ISO) 有什么问题? That should work fine.那应该可以正常工作。 Any time format other than *USA should work to get hhmmss. *USA 以外的任何时间格式都应该可以得到 hhmmss。

dcl-s wtime Zoned(6); dcl-s wtime 分区(6); wtime= %Dec(%Time()): wtime= %Dec(%Time()):

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM