InitialObjectDescriptor { objectDescriptorID 1 audioProfileLevelIndication 255 visualProfileLevelIndication 254 sceneProfileLevelIndication 1 graphicsProfileLevelIndication 1 ODProfileLevelIndication 1 esDescr [ ES_Descriptor { ES_ID 1 decConfigDescr DecoderConfigDescriptor { streamType 3 decSpecificInfo BIFSConfig { isCommandStream true pixelMetric true pixelWidth 260 pixelHeight 70 } } } ] } OrderedGroup { children [ Background2D { backColor 1 1 1 } WorldInfo { info ["This shows script used to retrieve system time" "" "GPAC Regression Tests" "(C) 2002-2004 GPAC Team"] title "Script Date() test" } Transform2D { children [ Shape { appearance Appearance { material Material2D { emissiveColor 0 0 0 filled TRUE } } geometry DEF TXT Text { string ["MPEG4 time on your system"] fontStyle FontStyle { justify ["MIDDLE" "MIDDLE"] size 18 } } } ] } DEF TIMER TimeSensor { loop TRUE } DEF SC Script { eventIn SFTime set_time field SFNode str USE TXT url ["javascript:function set_time(value, text) {today = new Date();the_day = today.getDate();the_weekday = today.getDay();the_month = today.getMonth();the_year = today.getYear();the_hour = today.getHours();the_minute = today.getMinutes();the_second = today.getSeconds();am_pm = 0;the_initials = 'a.m.';if (the_year < 1900) the_year = the_year + 1900;if ((the_hour >=2) && (the_hour <=11)) {am_pm = the_hour;the_initials = 'a.m.';} else if (the_hour == 0) {am_pm = 12;the_initials = 'a.m.';} else if (the_hour == 12) {am_pm = 12;the_initials = 'p.m.';} else if (the_hour >=13) {am_pm = the_hour - 12;the_initials = 'p.m.';}if (the_minute <=9) the_minute = '0' + (the_minute);if (the_second <=9) the_second = '0' + (the_second);if (the_month == '0') the_month = 'January';else if (the_month == '1') the_month = 'February';else if (the_month == '2') the_month = 'March';else if (the_month == '3') the_month = 'April';else if (the_month == '4') the_month = 'May';else if (the_month == '5') the_month = 'June';else if (the_month == '6') the_month = 'July';else if (the_month == '7') the_month = 'August';else if (the_month == '8') the_month = 'September';else if (the_month == '9') the_month = 'October';else if (the_month == '10') the_month = 'November';else if (the_month == '11') the_month = 'December';if (the_weekday == '0') the_weekday = 'Sunday';else if (the_weekday == '1') the_weekday = 'Monday';else if (the_weekday == '2') the_weekday = 'Tuesday';else if (the_weekday == '3') the_weekday = 'Wednesday';else if (the_weekday == '4') the_weekday = 'Thursday';else if (the_weekday == '5') the_weekday = 'Friday';else if (the_weekday == '6') the_weekday = 'Saturday';if (the_day == '1') the_day = '1st';else if (the_day == '2') the_day = '2nd';else if (the_day == '3') the_day = '3rd';else if (the_day == '4') the_day = '4th';else if (the_day == '21') the_day = '21st';else if (the_day == '22') the_day = '23rd';else if (the_day == '31') the_day = '31st';else the_day = the_day + 'th';str.string[1] = the_weekday + ' ' + the_day + ' ' + the_month + ', ' + the_year;str.string[2] = am_pm + ':' + the_minute + ':' + the_second + ' ' + the_initials;}function initialize() {set_time(0, 0);}" ] } ] } ROUTE TIMER.cycleTime TO SC.set_time