Skip to main content
Participant
March 2, 2009
Question

Error in createdatetime

  • March 2, 2009
  • 12 replies
  • 4457 views
<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 has been closed for replies.

    12 replies

    djl2445Author
    Participant
    March 2, 2009
    Here is the error.
    Date value passed to date function CreateDateTime is unspecified or invalid.
    Specify a valid date in CreateDateTime function.

    Inspiring
    March 2, 2009
    quote:

    Originally posted by: djl2445
    Here is the error.
    Date value passed to date function CreateDateTime is unspecified or invalid.
    Specify a valid date in CreateDateTime function.



    You are passing it a string. Not sure why it work for Adam and not for you.
    Inspiring
    March 2, 2009
    > Looks like daylight savings time problem. Looking for help in fixing.

    It'd help if you posted what error you're getting.

    That code works fine for me.

    You don't need the pound-signs on the third line, btw. This will not
    impact your situation at all, but it makes your code look tidier.

    --
    Adam