|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Quote:
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? |
|
#4
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Date Formatting ERROR |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|