Progress - Como tomar la hora del servidor en Progress Grafico

 
Vista:

Como tomar la hora del servidor en Progress Grafico

Publicado por Miguel Angel Rossi (6 intervenciones) el 24/08/2016 15:06:31
Buenos dias al foro
Estoy migrando Progress en version caracter (9.1e) a version Grafica, y me encuentro con que la hora y la fecha son tomadas de la PC (o sea de windows) y no del servidor linux, con lo cual se me presentan inconvenientes si algun usuario modifica fecha y hora de su PC.
Habra algun parametro de arranque que me permita hacer que los programas tomen los datos del servidor??
Aguardo respuestas.
Muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Como tomar la hora del servidor en Progress Grafico

Publicado por Miguel (3 intervenciones) el 24/08/2016 18:55:43
Buenos dias,

Puede probar con esta instrucción al inicio de la aplicación

SESSION:TIME-SOURCE = "base_de_datos".
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Como tomar la hora del servidor en Progress Grafico

Publicado por Miguel Angel Rossi (6 intervenciones) el 24/08/2016 19:07:34
Muchas gracias por su ayuda.
En un rato pruebo esto a ver si funciona.
Nuevamente muchas gracias
Miguel Rossi
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Como tomar la hora del servidor en Progress Grafico

Publicado por Juan Carlos (3 intervenciones) el 28/09/2016 19:49:23
yo lo intente pero no resulto, agradecería un pequeño ejemplo.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Como tomar la hora del servidor en Progress Grafico

Publicado por Miguel (3 intervenciones) el 29/09/2016 16:11:01
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/*fecha.w*/
&ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12 GUI
&ANALYZE-RESUME
&Scoped-define WINDOW-NAME CURRENT-WINDOW
&Scoped-define FRAME-NAME Dialog-Frame
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Dialog-Frame
/*------------------------------------------------------------------------

  File: Fecha.w

  Description: Muestra la fecha y hora del equipo cliente local y del servidor  remoto donde se encuentre la base de datos

  Input Parameters:
      <none>

  Output Parameters:
      <none>

  Author: Miguel

  Created: 29/09/2016
------------------------------------------------------------------------*/
/*          This .W file was created with the Progress AppBuilder.       */
/*----------------------------------------------------------------------*/
 
/* ***************************  Definitions  ************************** */
 
/* Parameters Definitions ---                                           */
/* Local Variable Definitions ---                                       */
 
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
 
 
&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
 
/* ********************  Preprocessor Definitions  ******************** */
 
&Scoped-define PROCEDURE-TYPE Dialog-Box
&Scoped-define DB-AWARE no
 
/* Name of designated FRAME-NAME and/or first browse and/or first query */
&Scoped-define FRAME-NAME Dialog-Frame
 
/* Standard List Definitions                                            */
&Scoped-Define DISPLAYED-OBJECTS FECHAS HORAS FECHAL HORAL
 
/* Custom List Definitions                                              */
/* List-1,List-2,List-3,List-4,List-5,List-6                            */
 
/* _UIB-PREPROCESSOR-BLOCK-END */
&ANALYZE-RESUME
 
 
 
/* ***********************  Control Definitions  ********************** */
 
/* Define a dialog box                                                  */
 
/* Definitions of the field level widgets                               */
DEFINE VARIABLE FECHAL AS DATE FORMAT "99/99/9999":U
     LABEL "Fecha Local"
     VIEW-AS FILL-IN
     SIZE 11 BY 1.87 NO-UNDO.
 
DEFINE VARIABLE FECHAS AS DATE FORMAT "99/99/9999":U
     LABEL "Fecha Server"
     VIEW-AS FILL-IN
     SIZE 11 BY 1.87 NO-UNDO.
 
DEFINE VARIABLE HORAL AS CHARACTER FORMAT "X(20)":U
     LABEL "Hora Local"
     VIEW-AS FILL-IN
     SIZE 14.5 BY 1.87 NO-UNDO.
 
DEFINE VARIABLE HORAS AS CHARACTER FORMAT "X(20)":U
     LABEL "Hora Server"
     VIEW-AS FILL-IN
     SIZE 14.5 BY 1.87 NO-UNDO.
 
 
/* ************************  Frame Definitions  *********************** */
 
DEFINE FRAME Dialog-Frame
     FECHAS AT ROW 2.07 COL 19 COLON-ALIGNED WIDGET-ID 8 NO-TAB-STOP
     HORAS AT ROW 2.07 COL 44.88 COLON-ALIGNED WIDGET-ID 12 NO-TAB-STOP
     FECHAL AT ROW 4.33 COL 19 COLON-ALIGNED WIDGET-ID 10 NO-TAB-STOP
     HORAL AT ROW 4.33 COL 44.88 COLON-ALIGNED WIDGET-ID 14 NO-TAB-STOP
     SPACE(5.24) SKIP(1.26)
    WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER
         SIDE-LABELS NO-UNDERLINE THREE-D  SCROLLABLE
         TITLE "FECHAS" WIDGET-ID 100.
 
 
/* *********************** Procedure Settings ************************ */
 
&ANALYZE-SUSPEND _PROCEDURE-SETTINGS
/* Settings for THIS-PROCEDURE
   Type: Dialog-Box
   Allow: Basic,Browse,DB-Fields,Query
   Other Settings: COMPILE
 */
&ANALYZE-RESUME _END-PROCEDURE-SETTINGS
 
 
 
/* ***********  Runtime Attributes and AppBuilder Settings  *********** */
 
&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
/* SETTINGS FOR DIALOG-BOX Dialog-Frame
   FRAME-NAME                                                           */
ASSIGN
       FRAME Dialog-Frame:SCROLLABLE       = FALSE
       FRAME Dialog-Frame:HIDDEN           = TRUE.
 
/* SETTINGS FOR FILL-IN FECHAL IN FRAME Dialog-Frame
   NO-ENABLE                                                            */
ASSIGN
       FECHAL:READ-ONLY IN FRAME Dialog-Frame        = TRUE.
 
/* SETTINGS FOR FILL-IN FECHAS IN FRAME Dialog-Frame
   NO-ENABLE                                                            */
ASSIGN
       FECHAS:READ-ONLY IN FRAME Dialog-Frame        = TRUE.
 
/* SETTINGS FOR FILL-IN HORAL IN FRAME Dialog-Frame
   NO-ENABLE                                                            */
ASSIGN
       HORAL:READ-ONLY IN FRAME Dialog-Frame        = TRUE.
 
/* SETTINGS FOR FILL-IN HORAS IN FRAME Dialog-Frame
   NO-ENABLE                                                            */
ASSIGN
       HORAS:READ-ONLY IN FRAME Dialog-Frame        = TRUE.
 
/* _RUN-TIME-ATTRIBUTES-END */
&ANALYZE-RESUME
 
 
 
 
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Dialog-Frame
 
 
/* ***************************  Main Block  *************************** */
 
/* Parent the dialog-box to the ACTIVE-WINDOW, if there is no parent.   */
IF VALID-HANDLE(ACTIVE-WINDOW) AND FRAME {&FRAME-NAME}:PARENT eq ?
THEN FRAME {&FRAME-NAME}:PARENT = ACTIVE-WINDOW.
 
 
/* Now enable the interface and wait for the exit condition.            */
/* (NOTE: handle ERROR and END-KEY so cleanup code will always fire.    */
MAIN-BLOCK:
DO ON ERROR   UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
   ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:
    /*TOMA HORA SERVIDOR REMOTO*/
   SESSION:TIME-SOURCE = "SPORTS".
   ASSIGN FECHAS = TODAY
          HORAS  = STRING(TIME,"HH:MM:SS").
   /*TOMA HORA CLIENTE LOCAL*/
   SESSION:TIME-SOURCE = "".
   ASSIGN FECHAL = TODAY
          HORAL  = STRING(TIME,"HH:MM:SS").
  RUN enable_UI.
  DISPL  FECHAL HORAL FECHAS HORAS WITH FRAME {&FRAME-NAME}.
  WAIT-FOR GO OF FRAME {&FRAME-NAME}.
END.
RUN disable_UI.
 
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
 
 
/* **********************  Internal Procedures  *********************** */
 
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI Dialog-Frame  _DEFAULT-DISABLE
PROCEDURE disable_UI :
/*------------------------------------------------------------------------------
  Purpose:     DISABLE the User Interface
  Parameters:  <none>
  Notes:       Here we clean-up the user-interface by deleting
               dynamic widgets we have created and/or hide 
               frames.  This procedure is usually called when
               we are ready to "clean-up" after running.
------------------------------------------------------------------------------*/
  /* Hide all frames. */
  HIDE FRAME Dialog-Frame.
END PROCEDURE.
 
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
 
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI Dialog-Frame  _DEFAULT-ENABLE
PROCEDURE enable_UI :
/*------------------------------------------------------------------------------
  Purpose:     ENABLE the User Interface
  Parameters:  <none>
  Notes:       Here we display/view/enable the widgets in the
               user-interface.  In addition, OPEN all queries
               associated with each FRAME and BROWSE.
               These statements here are based on the "Other
               Settings" section of the widget Property Sheets.
------------------------------------------------------------------------------*/
  DISPLAY FECHAS HORAS FECHAL HORAL
      WITH FRAME Dialog-Frame.
  VIEW FRAME Dialog-Frame.
  {&OPEN-BROWSERS-IN-QUERY-Dialog-Frame}
END PROCEDURE.
 
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar