Time of day

Discussion about Code Builder Builder and Winlog language support.
mathias
Posts: 18
Joined: Thu Oct 06, 2011 9:40 am

Time of day

Postby mathias » Fri Dec 02, 2011 2:41 pm

Is it possible to show the actual time of day (time of the PC) in a label? I tried to use “GetTimeString(":")” but i don’t find a solution.

Thanks
Attachments
time.JPG
time.JPG (9.69 KiB) Viewed 3357 times

User avatar
admin
Site Admin
Posts: 306
Joined: Tue Nov 17, 2009 1:18 pm

Re: Time of day

Postby admin » Mon Dec 05, 2011 8:07 am

Hi,
yes, it is possible.
- Create a string gate with your desired name such as "DateTime".

- Enter in the Winlog code this function:

Code: Select all

Function void DateTime()
#startup
While(WindowIsOpen())
SetStrGateValue("DateTime", 0, GetTimeString(":"));
Sleep(1000);
end
end


- Attach the gate to the label in the template.


Return to “Code - Code Builder”

Who is online

Users browsing this forum: No registered users and 1 guest