我正在编码(又名 OpenEdge ABL)。
我有一个保存时间的变量,我想弄清楚它是否大于当前时间。
但是我在我读过的文档中找不到任何向我展示如何检索当前正在进行的时间的内容。
我只能找到有关检索当前日期的信息(使用 Today 关键字)。
顺便说一句,如果使用 Today 关键字包括日期的时间部分,那很好,但是我需要知道如何仅隔离时间部分。
谢谢。 (请注意,我所指的时间类型是一个整数,表示自午夜以来的秒数)
最佳答案
在版本 10 之前:
define variable t as integer no-undo. /* time, in seconds, since midnite */
t = time.
display t.
版本 10 之后(如果您想要合并日期和时间):
define variable dt as datetime no-undo.
dt = now.
display dt.
将现有时间变量与当前时间进行比较:
define variable t as integer no-undo initial 12345. /* 3:25:45 am */
display t > time.
从 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" ).
关于progress-4gl - 如何获取当前进行中的时间 (OpenEdge),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17706347/