AS of the clock displayed on 9CBS

xiaoxiao2021-03-06  39

Oneterframe = function () {

Time_date = new date ();

SE = new string ();

VAR TS = Time_Date.getSeconds ();

SE = TS;

IF (TS <10) {

/ / Set the format of the display time if it is less than 0, such as 3, then display 03

SE = "0" TS;

}

Mi = new string ();

VAR TM = TIME_DATE.GETMINUTES ();

Mi = Tm;

IF (tm <10) {

Mi = "0" Tm;

}

HO = new string ();

VAR TH = Time_Date.GetHours ();

HO = TH;

IF (th <10) {

HO = "0" TH;

}

Time_txt.text = ho ":" mi ":" se;

// The display format is xx: xx: xx

Date_txt.text = (Time_Date.GetyEAR () - 100) "'" " " (Time_Date.getMonth () 1);

Var week = new string ();

Switch (time_date.getday ()) {

/ / Set the week's format

Case 1:

Week = "MON";

Break;

Case 2:

Week = "TUS";

Break;

Case 3:

Week = "WED";

Break;

Case 4:

Week = "thu";

Break;

Case 5:

Week = "fri";

Break;

Case 6:

Week = "STA";

Break;

Case 0:

Week = "sun";

Break;

}

IF (! time_date.getday ()) {

// Special settings, if it is Sunday on the day, then display the font as red

Week_txt.textcolor = 0xDD0000;

// TextColor is a 16-in color, here is red

}

Week_txt.text = week;

}

// AS is ending the _txt is the "label" (instance name) of dynamic text, you can call text and TextColor properties

转载请注明原文地址:https://www.9cbs.com/read-76627.html

New Post(0)