btpoole
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2015
06:30 PM
Show Time on Screen
How can you show standard time that updates with time change? I am able to show time on screen but I have to call dt.roDateTime, then convert to standard time. My code is below and not very convenient just to show the standard time.
datetime=createobject("roDateTime")
dt=createobject("roDateTime")
dt.tolocaltime()
chour=dt.GetHours()
cminute=dt.GetMinutes()
IF chour=0
chour=12
ampm="AM"
ELSE
If chour=12
chour=12
ampm="PM"
Else
If chour>12
chour= chour-12
ampm="PM"
Else
If chour<12
chour=chour
ampm="AM"
ENDIF
ENDIF
ENDIF
ENDIF
if dt.getMinutes() <10
cminute="0"+str(dt.getMinutes())
else
cminute=str(dt.getMinutes())
end if
ctime=str(chour) + ":" + cminute + " " + ampm
2 REPLIES 2
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2015
06:40 PM
Re: Show Time on Screen
That looks about right - as long as you call that every minute to update the display.
btpoole
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2015
06:59 PM
Re: Show Time on Screen
Yep that's what stinks about it. Kinda of thought maybe there was a simple component or brightscript function that displayed standard time like on the main roku screen.