我迷路了,我可以检查非UTC时间,并且一切正常。 但是当转换为UTC Times时,CFIF不起作用
NON UTC {ts'2019-11-10 14:59:46'} LTE {ts'2019-11-10 14:00:00'}
UTC if {ts'2019-11-10 21:59:46'} LTE {ts'2019-11-10 21:00:00'}
我迷路了……似乎无法弄清楚。
<cfset timenow = #Now()#>
<cfset utimenow = dateConvert("Local2UTC",timenow)>
<cfset admintime = #DateAdd("h",-1,chk.stime)#>
<cfset uadmintime = #DateAdd("h",chk.utcact)#>
chk.stime和chk.utc时间正确。基本上,取消窗口要花一个小时的时间。
这些是创建的时间戳。
NON UTC {ts '2019-11-10 14:59:46'} LTE {ts '2019-11-10 14:00:00'}
NonUTC时间戳是没有UTC转换的时间戳。
UTC if {ts '2019-11-10 21:59:46'} LTE {ts '2019-11-10 21:00:00'}
NonUTC邮票
<cfif timenow LTE admintime>
This one works fine...
NON UTC {ts '2019-11-10 14:59:46'} LTE {ts '2019-11-10 14:00:00'}
Then allow cancel
<cfelse>
This cfelse is activated properly and Can't Cancel.
Can't Cancel
</cfif>
UTC Stamps
<cfif utimenow LTE uadmintime>
This one does not work
UTC if {ts '2019-11-10 21:59:46'} LTE {ts '2019-11-10 21:00:00'}
Then allow cancel
This UTC Time does not activate properly and allows the cancel.
Executes/activates inside the cfif - it should not
<cfelse>
Can't Cancel
</cfif>
我也尝试过转换以确保ODBCTime
<cfset uadmintime = createODBCDateTime(uadmintime)>
我最终不得不重新创建时间,并比较该格式。
现在,它可以同时与<cfif timenow LTE admintime>
和DateCompare
一起使用,如下所示。这一定是不喜欢{ts '2019-11-10 14:59:46'} LTE {ts '2019-11-10 14:00:00'}
格式的格式问题。
<cfset nctime = '#dateformat(uadmintime,"dd-MM-yyyy")# #timeformat(uadmintime,"hh:mm:ss")#'>
<cfset nutctime = '#dateformat(utimenow,"dd-MM-yyyy")# #timeformat(utimenow,"hh:mm:ss")#'>