PDA

View Full Version : System Time without seconds


home295
02-16-2009, 08:09 PM
Hi guys, I'm making a project for all my things, and I want to put a clock on it, as simple as that, however, I wanted to put one without the seconds counting. Basically, now my clock has Hours, minutes and seconds counting, and I want to remove the seconds counting, just that.

Currently I'm using this code:

On Show

sPCtime = System.GetTime(TIME_FMT_MIL)
Label.SetText("Label_Time", sPCtime)

Page.StartTimer(1000);

On Timer

sPCtime = System.GetTime(TIME_FMT_MIL)
Label.SetText("Label_Time", sPCtime)

Any suggestions?

Thanks in advance ;)

holtgrewe
02-16-2009, 10:24 PM
home295

Since the System.GetTime(TIME_FMT_MIL) returns a string variable, one way would be to display your time variable using String.Left command.

Label.SetText("Label_Time", String.Left(sPCtime, 5))

Displaying the leftmost 5 characters HH:MM

You were definately on the right track, keep experimenting and use the help file and search the forum. There is a wealth of knowledge there.

Welcome to the forum.

home295
02-19-2009, 04:06 PM
It worked perfectly, exactly what I needed, thank you very much holtgrewe :D