Skip to main content
Mar 2, 2009 4:48 PM UTC
Question

Error in createdatetime

<cfset schedindtl.presstime = 230>
<cfset schedindtl.pressdate = 20090308>
<cfset pressstart = #createdatetime(mid(schedindtl.pressdate,1,4),mid(schedindtl.pressdate,5,2),mid(schedindtl.pressdate,7,2),int(schedindtl.presstime/100),int(right(tostring(schedindtl.presstime),2)),0)#>
pressstart = #pressstart#

Looks like daylight savings time problem. Looking for help in fixing.
    This topic is closed to new replies. Start a new post to keep the conversation going.

    27 replies

    Inspiring
    Mar 13, 2022 7:01 PM UTC

    I am having a problem here:

     

    <cfscript>
    writeoutput(createdatetime(2022,03,13,2,0,0));
    </cfscript>

     

    Got this error:

    Date value passed to date function createDateTime is unspecified or invalid.

     

    Is this related w/ the JVM that I am using? Please help. Thanks.

    Translate
    Inspiring
    Mar 13, 2022 7:11 PM UTC

    Just reported the bug:
    https://tracker.adobe.com/#/view/CF-4212875

    Translate
    BKBK
    Community Expert
    Community Expert
    Mar 14, 2022 5:23 PM UTC

    @joseph.yan ,

    Does the following help as a workaround?

    • add the timezone flag to java.args in the jvm.config file. For example, I have added:
      -Duser.timezone=Europe/London
    Translate
    tclaremont
    Inspiring
    Mar 5, 2009 9:22 PM UTC
    As long as we are thinking global, does CFFLUSH go counter-clockwise south of the equator? Something to think about when programming for a global market.
    Translate
    tclaremont
    Inspiring
    Mar 5, 2009 9:20 PM UTC
    It was not a matter of ethnocentricism. I just know for a fact that CrystalTech is in Arizona and one of the exceptions to DST observations!
    Translate
    Inspiring
    Mar 5, 2009 8:42 PM UTC
    >> Wait a minute. Wouldn't that time be perfectly valid for the portions of the
    >> US that do not observe daylight savings time? Arizona and Hawaii do not observe
    >> DST. Indiana did not observe DST until 2005.

    A can't *believe* I didn't have more concerted swipe at you for only
    considering USA when made your observation above.

    A wasted opportunity!

    ;-)

    --
    Adam
    Translate
    Inspiring
    Mar 5, 2009 8:31 PM UTC
    > Wait a minute. Wouldn't that time be perfectly valid for the portions of the
    > US that do not observe daylight savings time? Arizona and Hawaii do not observe
    > DST. Indiana did not observe DST until 2005.

    Yep, and it'll work fine in those TZs. It's only when the server is
    configured to be in one of the affected TZs that it's a problem. I'm on
    GMT here and the code works fine, because our DLS boundary is different.
    29/3/2009 01:30 bombs for me.


    > CrystalTech, a popular CF webhost, is situated in Arizona, I believe. It would
    > seem to me that the server time would be perfectly valid on those boxes,
    > wouldn't it? Is it simply a matter of not applying the DST patch to those
    > machines?

    If one is serving content across TZs, one should really have the server set
    to UTC and have your code offset the time as per requirements. Paul
    Hastings might be watching out, and this would be his cue to jump in and
    explain all that. He's the expert.

    --
    Adam
    Translate
    tclaremont
    Inspiring
    Mar 5, 2009 4:26 PM UTC
    It does seem like a more helpful error could be thrown in that instance, doesn't it?

    Wait a minute. Wouldn't that time be perfectly valid for the portions of the US that do not observe daylight savings time? Arizona and Hawaii do not observe DST. Indiana did not observe DST until 2005.

    CrystalTech, a popular CF webhost, is situated in Arizona, I believe. It would seem to me that the server time would be perfectly valid on those boxes, wouldn't it? Is it simply a matter of not applying the DST patch to those machines?
    Translate
    tclaremont
    Inspiring
    Mar 4, 2009 9:22 PM UTC
    That date and time is precisely when daylight savings time occurs for the EST time zone in North America. At 2:00 AM it will become 3:00 AM, and therefore 2:00 AM does not exist on 3/8/2009.

    I can only guess that this is the rationale for it being an invalid date/time.
    Translate
    Inspiring
    Mar 4, 2009 10:29 PM UTC
    That makes sense to me. Thanks for your assistance.
    Translate
    Mar 2, 2009 7:09 PM UTC
    If I change it from 230 to 330 it works. We are looking for fixes to the server OS.
    Translate
    Inspiring
    Mar 4, 2009 9:07 PM UTC
    I am also getting this error. Seems to be a problem with the date 2009-03-08 and time of 2am.

    For example:

    CreateDateTime(2009, 3, 8, 2, 45, 0)

    Will through the following error:

    Date value passed to date function CreateDateTime is unspecified or invalid.
    Specify a valid date in CreateDateTime function.

    Translate
    Mar 2, 2009 6:43 PM UTC
    Version 8.0.1 We are looking at the server for patches. Is this to the operatings system or CF8. We didn't find a patch for CF8.
    Translate
    tclaremont
    Inspiring
    Mar 2, 2009 6:01 PM UTC
    What version of CF? Have the daylight savings time patches been applied to the server? If you do a CFDUMP, what value is being passed to the server?
    Translate