如果时间在 00.00 和 03.00 AM 之间,则布尔值为真
Getting boolean true if time is between 00.00 and 03.00 AM
如果当前时间在凌晨 00.00 到 03.00 之间,是否可以使用 lotusscript 获得布尔值 true?
是的。
查看 notesdatetime class 及其 timedifference/timedifferencedouble 函数。
好吧......有一个微小的可能性,即在这个过程中的操作之间,时间会在午夜时分滴答作响,这可能会影响结果......但是像这样的事情应该做技巧:
dim currentDT as new NotesDateTime
dim currentDayMidnight as new NotesDateTime("Today 12:00 AM") ' Doc says you can do this, although I never have!
dim isInRange as boolean
isInRange = false
call currentDT.setNow()
' check if current time is within 3 hours of midnight
if currentDT.TimeDifference(currentDayMidnight) <= (3 * 60 * 60) then
isInRange = true
end if
如果当前时间在凌晨 00.00 到 03.00 之间,是否可以使用 lotusscript 获得布尔值 true?
是的。
查看 notesdatetime class 及其 timedifference/timedifferencedouble 函数。
好吧......有一个微小的可能性,即在这个过程中的操作之间,时间会在午夜时分滴答作响,这可能会影响结果......但是像这样的事情应该做技巧:
dim currentDT as new NotesDateTime
dim currentDayMidnight as new NotesDateTime("Today 12:00 AM") ' Doc says you can do this, although I never have!
dim isInRange as boolean
isInRange = false
call currentDT.setNow()
' check if current time is within 3 hours of midnight
if currentDT.TimeDifference(currentDayMidnight) <= (3 * 60 * 60) then
isInRange = true
end if