Click to See Complete Forum and Search --> : Dynamic Clock with an input parameter?
petervidal
07-14-2003, 09:28 AM
Hi list:
I am developing a Time & Attendance page on which I need to display a dynamic clock. Due to the fact that we have all our international businesses on a IBM iSeries, we are using the mainframe system time and then, depending on the time zone of the user(s), do the adjustment in time and determine the actual time. We do not want to use PC time nor any server time, just our mainframe's.
I need to be able then to send the "calculated time" to this T&A page and pass this somehow to the clock code so it can run based on the time that was sent to it as a parameter.
Is this possible?
Khalid Ali
07-14-2003, 10:33 AM
I am hoping that you should be able to create varaibles in JS witht he current time from your mainframe and then set the time using js on clients side with those values...from that point on javascript should run th eclock on those settings..let me know what happens....
petervidal
07-21-2003, 09:51 AM
Thanks! Sorry I did not respond before. I will try your idea and keep you posted. Thanks again!
Peter
petervidal
08-01-2003, 02:41 PM
I am still struggling but getting closer...
I have this script and works great! Now, I want my mainframe time to be displayed dynamically on the page itself rather than the bar in the lower part of the window.
Can you show me the way???
Best regards,
Peter Vidal
:confused: :confused: :confused:
Here is the script:
%HTML (START) {
<html>
<head>
<script type="text/javascript">
<!--
var os400time = new Date();
function updateos400time() {
os400time.setTime(os400time.getTime() + 1000);
status='OS/400 time is ' + os400time + ' client time is ' + new Date();;} @DTW_TIME("N",mytime)
os400time.setHours(@DTW_rSUBSTR(mytime,"1","2"));
os400time.setMinutes(@DTW_rSUBSTR(mytime,"4","2"));
os400time.setSeconds(@DTW_rSUBSTR(mytime,"7","2"));
var myinterval = window.setInterval("updateos400time()",1000);
//-->
</script>
</head>
<BODY>
Watch the status line. You could even put a window with something to work in front
of this one and you might still be able to see the status line...
</body>
</html>
%}
petervidal
08-04-2003, 10:41 AM
So far, I have this:
%HTML (START) {
<html>
<head>
</head>
<BODY onLoad="clock()">
<span id="pendule" style="position:left;left:300;top:20;"></span>
<SCRIPT LANGUAGE="JavaScript">
function clock() {
if (!document.layers && !document.all) return;
var digital = new Date();
@DTW_TIME("N",srvtime)
var hours = @DTW_rSUBSTR(srvtime,"1","2");
var minutes = @DTW_rSUBSTR(srvtime,"4","2");
var seconds = @DTW_rSUBSTR(srvtime,"7","2");
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
dispTime = hours + ":" + minutes + ":" + seconds;
if (document.layers) {
document.layers.pendule.document.write(dispTime);
document.layers.pendule.document.close();
}
else
if (document.all)
pendule.innerHTML = dispTime;
setTimeout("clock()", 1000);
}
// End -->
</script>
</body>
</html>
%}
**** I can display the time just one and nothing else hgappens. I can't put it to change dynamically. What I am doing wrong, or what I'm not going at all?
TIA,
Peter Vidal
:eek: :eek: