Skip to main content
June 6, 2007
Question

problem with parseDateTime

  • June 6, 2007
  • 2 replies
  • 391 views
I have a problem with the ParseDateTime function on some days, and using the POP option i get the wrong data. I think that the problem is at the end and beginning of months and when trying to add hours on time. For example, when I use

<cfset dt = parseDateTime("Thu, 31 May 2007 17:31:41 +0300", "pop") />

i get

{ts '2007-06-01 14:31:41'}

instead of

{ts '2007-05-31 14:31:41'}.

I need your help. Thanking you in advance.
    This topic has been closed for replies.

    2 replies

    Inspiring
    June 7, 2007
    > <cfset dt = parseDateTime("Thu, 31 May 2007 17:31:41 +0300", "pop") />
    >
    > i get
    >
    > {ts '2007-06-01 14:31:41'}
    >
    > instead of
    >
    > {ts '2007-05-31 14:31:41'}.

    What TZ is your server in?

    "Thu, 31 May 2007 17:31:41 +0300" could well be "{ts '2007-06-01
    14:31:41'}" in your TZ.

    --
    Adam
    June 7, 2007
    The TZ of the server is in GMT +0200.
    The output of the cf function gettimeZoneInfo() is:

    isDSTon = YES
    utcHourOffset = -3
    utcMinuteOffset = 0
    utcTotalOffset = -10800

    and the output of the java utils function
    <cfset tTime = CreateObject("java", "java.util.TimeZone")>
    #tTime.getDefault()#

    is
    sun.util.calendar.ZoneInfo[id="Europe/Athens",offset=7200000,dstSavings=3600000,useDaylight=true,transitions=138,lastRule=java.util.SimpleTimeZone[id=Europe/Athens,offset=7200000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]]

    Note that the function works correctly for all the other dates. The problem is only at the last and first day of each month. I hope that this will help you solve my problem.


    Inspiring
    June 6, 2007
    <cfset dt = parseDateTime("Thu, 31 May 2007 17:31:41 +0300") />

    Remove the "pop"
    June 7, 2007
    Thanks for your reply. But the problem is that I need the POP. I use it for email handling.

    Regards.