4 posts
Location
Utah
Posted 10 May 2012 - 08:39 PM
How can I show the time or date at the startup of the computer, minecraft time or real world?
For example when the terminal starts up, i'd like it to look something like this:
Welcome User, The Current Time Is: (clock or date)
1111 posts
Location
Portland OR
Posted 10 May 2012 - 10:16 PM
You can use os.time() which will return the Minecraft time. As far as I know vanilla CC will not display the real time.
2217 posts
Location
3232235883
Posted 14 May 2012 - 01:01 AM
you can either put this in a startup file or the shell itself, it also makes it the standard time format
a=math.floor(os.time())
b=math.floor((os.time()-a)*60)
if a > 11 then c="PM" a=a-12 else c="AM" end
if b < 10 then b="0"..b end
if a==0 then a=12 end
print("Welcome User, The Current Time Is: "..a..":"..b.." "..c)
-- mormons
1604 posts
Posted 14 May 2012 - 01:18 AM
you can either put this in a startup file or the shell itself, it also makes it the standard time format
a=math.floor(os.time())
b=math.floor((os.time()-a)*60)
if a > 11 then c="PM" a=a-12 else c="AM" end
if b < 10 then b="0"..b end
if a==0 then a=12 end
print("Welcome User, The Current Time Is: "..a..":"..b.." "..c)
-- mormons
It's easier to use textutils.formatTime():
print("Welcome User")
print("The current time is: ", textutils.formatTime(os.time(), true))