#VRML V2.0 utf8 NavigationInfo { type "NONE" } Shape { geometry DEF time Text { fontStyle FontStyle { justify "MIDDLE" size 2.8 } } } DEF count TimeSensor { loop TRUE cycleInterval 1 } DEF timeScript Script { eventIn SFTime clock directOutput TRUE field SFNode timeOut USE time url "javascript: function clock(){ var Digital=new Date() var hours=Digital.getHours() var minutes=Digital.getMinutes() var seconds=Digital.getSeconds() var ending='AM' if (hours>12){ ending='PM' hours=hours-12 } if (hours==0) hours=12 if (minutes<=9) minutes='0'+minutes if (seconds<=9) seconds='0'+seconds var ctime=hours+':'+minutes+':'+seconds+' '+ending textString = new MFString(); textString[0] = ctime timeOut.set_string = textString; } " } ROUTE count.cycleTime TO timeScript.clock