Clock source applet

1 reply [Last post]
brett
Offline
Providence, United States
Joined: 9 Jan 2010

This applet emits a targetless clock schema payload that can be picked up by other xAP devices to display the current date/time.

It's very simplisitic and demonstrates some of the formatting capabilities of the LUA os.date function and the xap.Timer

See the LUA references page for more os.date formatting options http://www.lua.org/pil/22.1.html

The output not quite what you want?..... go ahead and hack away!

Sample output:

xap-header
{
uid=FF00D800
source=dbzoo.livebox.Plugboard
hop=1
class=clock.report
v=12
}
date
{
utc=14:25:09
}
prettylocal
{
long=02:25 PM Tuesday, 18 October 2011
time=02:25 PM
short=02:25 PM 18-Oct-11
date=18-Oct-11
med=02:25 PM Tue, 18 Oct 11
}
time
{
utc=10/18/11
}

Brett

AttachmentSize
clockApplet.lua726 bytes
kevin9
Offline
Lincolnshire, United Kingdom
Joined: 24 May 2010
Thanks, and small correction

Thanks for this.

Haven't been abe to try this yet but I think it will be very useful

A minor correction in the attached file so that date and time appear in the correct subsection

cheers

kevint

AttachmentSize
clockApplet_1.lua 726 bytes
Hardware Info