ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 18th, 2005, 01:32 PM
TanzMatias TanzMatias is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 10 TanzMatias User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 53 m 3 sec
Reputation Power: 0
Date Formatting ERROR

I'm experiencing an anomaly with ColdFusion when formatting a string variable as a date at the moment Daylight Savings Time happens. I set a string variable to 2:00am on 4/3/05, however, when I format that string as a date/time I get 3:00am on 4/3/05. (NOTE: When I format a string an hour later at 3:00am I also get 3:00am as a result – CF will NOT return a time b/t 2:00am – 2:59am on 4/3/05.)

Could those of you in areas that observe DLS test the following .cfm script and let me know your results? Any idea why this is happening? Is there a setting I need to disable?
Thanks!

CODE:
----------
<CFSET myVar = '04/03/2005 2:00:00 AM'>
<CFOUTPUT><B>Myvar:</B> #myVar#</CFOUTPUT><BR>
<CFOUTPUT><B>MyVar Formatted:</B> #DateFormat(myVar, 'mm/dd/yyyy')# #TimeFormat(myVar, 'H:MM:SS TT')#</CFOUTPUT>

MY OUTPUT:
--------------------
Myvar: 04/03/2005 2:00:00 AM
MyVar Formatted: 04/03/2005 3:00:00 AM

Reply With Quote
  #2  
Old March 18th, 2005, 01:39 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,682 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 25 m 55 sec
Reputation Power: 53
This isn't an error. During daylight savings time, there is no time between 2-2:59 am. Time jumps from 2 to 3 at exactly 2 am.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old March 18th, 2005, 02:02 PM
TanzMatias TanzMatias is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 10 TanzMatias User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 53 m 3 sec
Reputation Power: 0
Quote:
Originally Posted by kiteless
This isn't an error. During daylight savings time, there is no time between 2-2:59 am. Time jumps from 2 to 3 at exactly 2 am.


I am aware of that, however, shouldn't the jump happen w/ the Server and not ColdFusion? I'm working with cities that do NOT observe DLS and I need to output their local time in relation to my time. (I actually need to insert their local time into a SQLServer DB field with a datatype of DATETIME.)

Any ideas?

Reply With Quote
  #4  
Old March 18th, 2005, 03:28 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,682 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 25 m 55 sec
Reputation Power: 53
Not sure, you may have to choose a different time zone to support it, and I think you have to do that through the underlying Java engine. Remember that under the hood CFMX is just using whatever date settings are in effect in the Java Runtime Engine. I'm sure that daylight savings is enabled by default.

Perhaps these links might help:

http://www.macromedia.com/cfusion/k...cfm?id=tn_18310

http://www.macromedia.com/devnet/mx...obalize_05.html

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Date Formatting ERROR


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT