Author Topic: time GMT  (Read 2559 times)

David

  • Guest
time GMT
« on: January 01, 1970, 09:00:00 AM »
Hi all,



I used ICC 6.1 The mails that I receive are recorded in the GCTICS database with the GMT time Zone. How is it possible to record those mails with another time zone.



Thanks

Jorge

  • Guest
time GMT
« Reply #1 on: January 01, 1970, 09:00:00 AM »
  • Best Answer
  • Hi David

    Which is your ICS Client version?

    Jorge


    Vivek

    • Guest
    time GMT
    « Reply #2 on: January 01, 1970, 09:00:00 AM »
  • Best Answer
  • I asked the same question to Genesys, they told me that it is hardcoded in the programe (I believe in Media link). Keep that in mind we are still using IS5.1.6. I am in EST.

    JimM

    • Guest
    time GMT
    « Reply #3 on: January 01, 1970, 09:00:00 AM »
  • Best Answer
  • I created the following function to convert the GMT to your local time.  Note that I'm using Oracle 8.1.7, and am in the central time zone.  You will need to convert the timezones for your situation.  Also, note that it checks for Daylight savings time.  Once again, you may need to adjust:



    function convert_gmt(check_date date)

    return date is

       start_dst date;            - date for start of daylight savings time

       end_dst date;              - date form end of daylight savings time

       start_sunday integer;      - day of the month for first Sunday in April

       end_sunday integer;        - day of the month for last Sunday in October

       year varchar2(5);          - current year

    begin

       year := to_char(check_date, 'YYYY');  - Get year for the given date.

       - compute the date of the first Sunday in April for the given year.

       start_sunday := mod(8  to_number(to_char(to_date('01APR'||year,'DDMONYYYY'),'D')),7) + 1;

       -dbms_output.put_line('start_sunday = ' || start_sunday);



       - compute the date of the last Sunday in October for the given year.

       end_sunday := 31  to_number(to_char(to_date('31OCT'||year,'DDMONYYYY'),'D')) + 1;

       -dbms_output.put_line('end_sunday = ' || end_sunday);



       - Compute the actual start dates and times for daylight savings time begin and end

       start_dst := to_date(to_char(start_sunday,'00')||'APR'||year||' 02:00:00 AM','DDMONYYYY HH:MI:SS AM');

       end_dst := to_date(to_char(end_sunday,'00')||'OCT'||year||' 02:00:00 AM','DDMONYYYY HH:MI:SS AM');



       - Check if daylight savings time is in effect

       if(check_date >= start_dst and check_date < end_dst) then

          return new_time(check_date, 'GMT', 'CDT');

       else

          return new_time(check_date, 'GMT','CST');

       end if;



    end convert_gmt;


    David

    • Guest
    time GMT
    « Reply #4 on: January 01, 1970, 09:00:00 AM »
  • Best Answer
  • My version is ICS 6.1, under Oracle 8.1.7



    Thanks to all of you

    David

    • Guest
    time GMT
    « Reply #5 on: January 01, 1970, 09:00:00 AM »
  • Best Answer
  • Hi Jim,



    Thanks for your help, I did not expect so much help.....

    Just one more question. How could I use your function ? Is it a kind of batch that I have to run every day ?

    JimM

    • Guest
    time GMT
    « Reply #6 on: January 01, 1970, 09:00:00 AM »
  • Best Answer
  • When I present the time, I use the function to do the conversion.  For example, "select convert_gmt(datesent) from emailin" will convert the times from GMT to your local time.  You need to have saved the convert_gmt function to your database.



    Right now, I have an "after insert" trigger on the emailin table and save the converted time.  That way, when you get emails, the converted time will be saved as soon as the email comes in.  You want to be sure to catch all the time fields.