use*_*449 4 progress-4gl openedge
我正在进行编码(又名OpenEdge ABL).
我有一个持有时间的变量,我想弄清楚它是否大于当前时间.
但我在我阅读的文档中找不到任何内容,告诉我如何检索当前的Time in Progress.
我只能找到有关检索当前日期的信息(使用Today关键字).
顺便说一句,如果使用Today关键字包含日期的时间部分,那很好,但是我需要知道如何仅隔离时间部分.
谢谢.(注意,我所指的时间是一个整数,表示自午夜起的秒数)
Tom*_*com 12
在版本10之前:
define variable t as integer no-undo. /* time, in seconds, since midnite */
t = time.
display t.
Run Code Online (Sandbox Code Playgroud)
版本10之后(如果您想要组合日期和时间):
define variable dt as datetime no-undo.
dt = now.
display dt.
Run Code Online (Sandbox Code Playgroud)
将现有时间变量与当前时间进行比较:
define variable t as integer no-undo initial 12345. /* 3:25:45 am */
display t > time.
Run Code Online (Sandbox Code Playgroud)
从DateTime变量中提取时间(以秒为单位)(并按照Jensd的建议很好地显示):
define variable t as integer no-undo.
define variable dt as datetime no-undo.
dt = now.
t = integer( mtime( dt ) / 1000 ).
display t string( t, "hh:mm:ss am" ).
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14189 次 |
| 最近记录: |