This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
kingkingkingkg's profile picture

[Questain] Print date

Started by kingkingkingkg, 19 July 2012 - 01:47 PM
kingkingkingkg #1
Posted 19 July 2012 - 03:47 PM
How do i print a date in a program
im making a news program and i need to know how to get the date to print it in the code!
MysticT #2
Posted 19 July 2012 - 03:54 PM
What do you mean by date? The actual real life date? You can't get it in the computer. However, you could use http to get it from some time server or something.
kingkingkingkg #3
Posted 20 July 2012 - 10:07 PM
What do you mean by date? The actual real life date? You can't get it in the computer. However, you could use http to get it from some time server or something.
how would i use the http to get it? or like can get the game time?
MysticT #4
Posted 20 July 2012 - 11:56 PM
You can get the time of the day (in-game time) using os.time(). If you need the real date, you need to get it using http. I think there's a program for this in the program library.
kingkingkingkg #5
Posted 21 July 2012 - 12:01 AM
it wont give me am or pm it gives me "14.95"
i need it to say am or pm is it in military time?
MysticT #6
Posted 21 July 2012 - 12:13 AM
The wiki is your friend, always remember that :)/>/> (Hint: look for formatTime)
kingkingkingkg #7
Posted 21 July 2012 - 12:21 AM
Thanks