tracker issue : CF-3323800

select a category, or use search below
(searches all categories and all time range)
Title:

TimeFormat does not display UTC times correctly after dateConvert

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Samuel Knowlton / Samuel Knowlton (Samuel Knowlton)

Created: 09/04/2012

Components: Language, Functions

Versions: 10.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: Final / 282898

Priority/Frequency: Major / All users will encounter

Locale/System: English / Win 2008 Server R2 64 bit

Vote Count: 3

Duplicate ID:	CF-3309220

Problem Description: When converting a time to UTC using DateConvert, TimeFormat does not display the converted date correctly. DateTimeFormat(utcTime,"UTC") does.

Steps to Reproduce:

<cfset localTime=now()>
<cfset localUTC=dateconvert("local2Utc",localtime)>
<cfoutput>
	<ul>
		<li>local time is #localtime#</li>
		<li>utc time is #localutc#</li>
		<li>formatted utc is #timeformat(localUTC,"HHmmss")#</li>
	</ul>
</cfoutput>

Actual Result:

Dumping the variable localutc correctly displays a UTC timestamp. Timeformat(localutc) displays the local (non-adjusted, non-UTC)  time. This is new since CF8 (we upgraded from 8 to 10):

local time is {ts '2012-09-04 07:43:13'}
utc time is {ts '2012-09-04 12:43:13'}
formatted utc is 074313

Expected Result:

The formatted utc time should match the timestamp (in the above example, 12:43, not 07:43)

Any Workarounds:

Use DateTimeFormat(timestamp,"UTC") though this will probably be incorrect if/when the bug is fixed since it is re-converting it, right?

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3323800

External Customer Info:
External Company:  
External Customer Name: Aquitaine
External Customer Email:  
External Test Config: My Hardware and Environment details: Win 2008 R2 x64, CF10.

Attachments:

Comments:

I am seeing the same thing on my version of ColdFusion 10 as well. Basically I cannot migrate this version to production because all my Amazon API calls will fail. This is a deal breaker.
Vote by External U.
18189 | September 11, 2012 08:25:57 AM GMT
Here is a potential workaround using the Mid() function. <cfset Timestamp = "#Mid(LocalTime,6,10)#T#Mid(LocalTime,17,8)#.00Z">
Comment by External U.
18186 | September 11, 2012 08:57:15 AM GMT
Confirmed: TimeFormat does not display UTC times correctly after dateConvert
Vote by External U.
18190 | September 28, 2012 04:55:05 PM GMT
This bug is only addresses one small symptom of the larger issue. Please see bug CF-3338974.
Comment by External U.
18187 | September 28, 2012 06:17:15 PM GMT
This one had me scratching my head. Good thing we caught it in testing, but I agree definitely a deal breaker. Timeformat with UTC has same issue.
Vote by External U.
18191 | October 15, 2012 12:28:00 AM GMT
temporary work around for this is: <cfset mydate = DateConvert('Local2UTC', now()).toString()>
Comment by External U.
18188 | October 15, 2012 12:37:34 AM GMT