Convert GMT datetime to local datetime

SOLVED

Hello Slight smile

I want to delete database entries which are older than 15 minutes.

datetime$ returns the date in GMT time zone.

But the database entries are stored in CET time zone (CREDATTIM column). The comparison not work as intended because of the 2 hours time difference.

I saw there is a method TIMEZONE_CSTD.TO_LOCAL.

With this method I tried converting the GMT datetime$ to CEST time zone.

Unfortunately it doesn't work. What do I wrong? How can I convert gmt datetime to local datetime with 4GL?

Thank you very much for your help.

Kind regards

Parents
  • +1
    verified answer

    The problem was that the second argument of the function is a datetime and not a string.

    In order to make it work you must use gdatetime$ around the datetime string.

    For example:

     

    In the table TIMEZONEINFO on column TADCOD_0 you can see possible time zones.

Reply
  • +1
    verified answer

    The problem was that the second argument of the function is a datetime and not a string.

    In order to make it work you must use gdatetime$ around the datetime string.

    For example:

     

    In the table TIMEZONEINFO on column TADCOD_0 you can see possible time zones.

Children
No Data