Date format issues

Hi all,

I have a program running through AcuConnect. There are AcuThin clients running from PCs with different regional settings.

Regarding reporting, how can automatically adjust the displayed Date control with the appropriate format? (dd/mm/yyyy for Europe clients, mm/dd/yyyy for America clients).

Bonus question: when running "ACCEPT my-var FROM DATE" from AcuThin client, my-var has the clent's date or the server's date? Is there a way to have a UTC/GMT date/time information through a function? 

Thank you

Th.

 

  • Verified Answer

    I do not know of a way to automatically adjust the displayed Date control with the appropriate format. I think you'll need to set up 2 different control, both invisible and then turn the appropriate one visible based on the user (or user preferences).  "ACCEPT my-var FROM DATE" from AcuThin client, my-var has the server's date, as the program is actually executing on the server, the display occurs on the client. You can access client side programs like dlls using this type of syntax CALL "@[DISPLAY]:MYLIB.DLL". I do not believe there is a function that we provide that provides UTC/GMT. There are probably a few web services or maybe some ActiveX controls that provide that functionality.

  • Regarding the Bonus Question:-

    We have a similar situation where a server in one time zone is supporting users and databases in multiple time-zones.

    Support for different time-zones is provided to our app by the operating system.  When a user connects, their identity on the AcuConnect server defines the time-zone they are in, and then ACCEPT FROM TIME returns the appropriate time for the user.

    Our server is running Linux, but I would assume Windows should be capable of the same approach.

  • Verified Answer

    The following KB article has a program attached called timezone.cbl.  

    community.microfocus.com/.../17351.determine-the-time-zone-in-an-acucobol-gt-program-running-on-windows.aspx

    It uses the GetTimeZonInformation method of kernel32.dll to obtain the machine's time zone.  In a Thin  Client implementation add the following runtime configuration settings to get the client time zone:

    CODE_MAPPING ON

    DLL_CONVENTION 1

    KERNEL32.dll @[DISPLAY]:C:\Windows\syswow64\KERNEL32.dll

    GetTimeZoneInformation @[DISPLAY]:GetTimeZoneInformation