Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce
Reporter/Name(from Bugbase): Steve Sommers / Steve Sommers ()
Created: 02/09/2017
Components: Core Runtime
Versions: 11.0
Failure Type: Others
Found In Build/Fixed In Build: 11,0,10,300066 /
Priority/Frequency: Normal /
Locale/System: English / Windows 7 SP1 64-bit
Vote Count: 0
Problem Description: DateTime comparisons seem to apply an underlying hidden time zone indicator to the comparison
Steps to Reproduce:
<cfscript>
local.dttm1 = createDateTime(2017,02,01,01,00,00);
local.dttm1UTC = dateConvert('local2utc', local.dttm1);
local.dttm2 = createDateTime(2017,02,01,02,00,00);
local.dttm2UTC = dateConvert('local2utc', local.dttm2);
local.dttm3 = createDateTime(2017,02,01,03,00,00);
local.dttm3UTC = dateConvert('local2utc', local.dttm3);
local.dttm2a = parseDateTime("#dateTimeFormat(local.dttm2,'yyyy-mm-dd hh:nn:ss')#");
local.dttm2aUTC = parseDateTime("#dateTimeFormat(local.dttm2UTC,'yyyy-mm-dd hh:nn:ss')#");
</cfscript>
<cfoutput>
local.dttm1UTC = #local.dttm1UTC#<br />
local.dttm2UTC = #local.dttm2UTC#<br />
local.dttm3UTC = #local.dttm3UTC#<br />
<br />
local.dttm1UTC < local.dttm2UTC = SHOULD BE YES<br />
#local.dttm1UTC# < #local.dttm2UTC# = #local.dttm1UTC LT local.dttm2UTC#<br />
<br />
local.dttm2UTC < local.dttm3UTC = SHOULD BE YES<br />
#local.dttm2UTC# < #local.dttm3UTC# = #local.dttm2UTC LT local.dttm3UTC#<br />
<br />
local.dttm2aUTC = #local.dttm2aUTC#<br />
<br />
local.dttm1UTC < local.dttm2aUTC = SHOULD BE YES<br />
#local.dttm1UTC# < #local.dttm2aUTC# = #local.dttm1UTC LT local.dttm2aUTC#<br />
<br />
local.dttm2aUTC < local.dttm3UTC = SHOULD BE YES<br />
#local.dttm2aUTC# < #local.dttm3UTC# = #local.dttm2aUTC LT local.dttm3UTC#<br />
</cfoutput>
Actual Result:
local.dttm1UTC = {ts '2017-02-01 09:00:00'}
local.dttm2UTC = {ts '2017-02-01 10:00:00'}
local.dttm3UTC = {ts '2017-02-01 11:00:00'}
local.dttm1UTC < local.dttm2UTC = SHOULD BE YES
{ts '2017-02-01 09:00:00'} < {ts '2017-02-01 10:00:00'} = YES
local.dttm2UTC < local.dttm3UTC = SHOULD BE YES
{ts '2017-02-01 10:00:00'} < {ts '2017-02-01 11:00:00'} = YES
local.dttm2aUTC = {ts '2017-02-01 10:00:00'}
local.dttm1UTC < local.dttm2aUTC = SHOULD BE YES
{ts '2017-02-01 09:00:00'} < {ts '2017-02-01 10:00:00'} = YES
local.dttm2aUTC < local.dttm3UTC = SHOULD BE YES
{ts '2017-02-01 10:00:00'} < {ts '2017-02-01 11:00:00'} = NO
Expected Result:
Last line should = YES
Any Workarounds:
I had to use dateTimeFormat and compare strings which works but seems HIGHLY inefficient.
Attachments:
Comments: