Consultor Eletrônico



Kbase P111293: How to exchange time between 4GL and Java SQL-92 clients
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   28/11/2005
Status: Unverified

GOAL:

How to exchange time between 4GL and Java SQL-92 clients

FIX:

The Progress 4GL time is counted in milliseconds since midnight.
the toString method of java.sql.Time allows to convert a Time object into a String object of format hh:mm:ss .
This string can be stored into a character field. Progress 4GL easily allows a conversion from a string into
an integer and vise versa. Below a 4GL code example:
DEF VAR t AS INT LABEL "int real time".
DEF VAR ax AS INT LABEL "int char field".
DEF TEMP-TABLE xt FIELD fxt AS INT LABEL "int time field" FIELD fct AS CHAR LABEL "char time field".
t = TIME.
CREATE xt.
ASSIGN fxt = t.
fct = STRING(fxt,"hh:mm:ss").
ax = (INT(SUBSTR(fct,1,2)) * 60 * 60) + INT(SUBSTR(fct,4,2)) * 60 + INT(SUBSTR(fct,7,2)).
DISP fxt ax t fct.