Skip to main content
Participating Frequently
May 6, 2011
Question

Daylight Savings in CF 9 for Linux

  • May 6, 2011
  • 3 replies
  • 3569 views

How do I fix the time in coldfusion to match that on my server?

The coldfusion time is always 1 hour behind the present server time.

I am running Red Hat Enterprise Linux 6.

    This topic has been closed for replies.

    3 replies

    stu215Author
    Participating Frequently
    June 15, 2011

    While parts of this thread were helpful, I obtained my final solution from:

    http://www.experts-exchange.com/Software/Server_Software/Web_Servers/ColdFusion/Q_27100088.html#a35976157

    Inspiring
    May 7, 2011

    what does this tell you?

    dst

    savings:=#dstSavings#");

    </cfscript

    Inspiring
    May 7, 2011

    what does this tell you?

    That these "jive" forums chew up responses and spit them out like garbage.

    Inspiring
    May 7, 2011

    it wouldn't be so bad but i already knew it might do that.

    pretend this is wrapped in a cfscript block....

    jre=createObject("java","java.lang.System");

    JREname=jre.getProperty("java.runtime.name");

    JREversion=jre.getProperty("java.runtime.version");

    tz=createObject("java","java.util.TimeZone").getDefault();

    tzName=tz.getDisplayName(true,tz.LONG);

    dstSavings=tz.getDSTSavings()/3600000;

    writeoutput("jre:=#JREname# #JREversion#
    tz:=#tzName#


    dst savings:=#dstSavings#");

    interesting side effect is that i found out oracle thinks there's an "Indochina

    Summer Time" with a DST savings of "0". oh those kidders

    ilssac
    Inspiring
    May 6, 2011

    ColdFusion does not maintian its own time data.

    ColdFusion gets the time from Java

    AFAIK, Java gets the tme from the server.

    What version of Java do you have installed?  If you somehow have an older version of Java, it may not be updated to the new US daylight savings rules that went into affect in 2007.  Presuming you and your server are in the US.

    Is everything configured to the correct timezone for where you are located?

    stu215Author
    Participating Frequently
    May 6, 2011

    Yes, I am in the US :: EST

    I am running the following version of Java:

    java version "1.6.0_17"

    OpenJDK Runtime Environment (IcedTea6 1.7.10) (rhel-1.39.b17.el6_0-x86_64)

    OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

    Current System Time :: Fri May 6 15:20:40 EDT 2011

    Coldfusion Time: Friday, May 6, 2011 2:20:09 PM

    What version should i have?

    ilssac
    Inspiring
    May 6, 2011

    stu215 wrote:

    java version "1.6.0_17"

    That is a pretty recent version of Java (I suspect it is the one that comes with CF9).

    IIRC, you *could* update to 1.6.0_20 as the latest version tested and supported with CF9.  According to this article [http://www.petefreitag.com/item/786.cfm] 1.6.0_24 will soon be offically tested and supported.

    You would have needed to have had a very old version of Java (something before 1.4.2_11) which I'm not sure would even work with CF9.  But you do still find people using systems that have not been updated since those versions were released.

    Have you confirmed what timezone the server thinks it lives in?