Internet PLC Forum

General => Technical support => Topic started by: Petty_boy on May 12, 2008, 02:54:41 AM

Title: 24 Hour Clock
Post by: Petty_boy on May 12, 2008, 02:54:41 AM
Hi,  I would like to add a 24H six digit clock to my project, I have looked at the example in the usr directory but when the time is using single numbers i.e 7:9:4 it doesn't look very professional.

Ideally I would like a 24H clock that uses six digits to represent the time in the above example i.e. 07:09:04., or 19:09:04.   I have tried adding some code to the above example by adding a "0" in front of the time[1] number if it is lower than 10  but I'm pulling my hair out trying to get it to work.....

Any assistance appreciated.



Title: Re:24 Hour Clock
Post by: support on May 12, 2008, 11:05:34 AM
You can use:

STR$(TIME[1],2)+":"+STR$(TIME[2],2)+":"+STR$(TIME[3],2) to get fixed two digit display.
Title: Re:24 Hour Clock
Post by: Petty_boy on May 12, 2008, 02:01:21 PM
Hi Many thanks.