777MrEpic
|
  |
| Joined: 17 Oct 2012 |
| Total Posts: 3998 |
|
| |
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 11 Jun 2013 10:56 AM |
I only know it from ComputerCraft.
Though... search for "ComputerCraft wiki os API" on Google, then you might learn about it.
- As, meep. Instance.new("UtilityObject", workspace).Name = "As8D" RAIN! |
|
|
| Report Abuse |
|
|
777MrEpic
|
  |
| Joined: 17 Oct 2012 |
| Total Posts: 3998 |
|
|
| 11 Jun 2013 10:57 AM |
>Knows it >Tells me to go to wiki |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 11 Jun 2013 11:02 AM |
Okay, citated from the CC wiki os API page's os.clock and os.time links:
- os.clock "Returns float, amount of time the computercraft computer has been running, in seconds. " This makes me think that it's simply identical to ElapsedTime(), as it will return how long time something (Roblox or a CC computer or whatever) has been running for.
- os.time "Returns float The current in-game time." Seems like this one is tick(), as it will return the amount of seconds since UNIX (or... hm... I have to rethink this)
- As, not on the API list. Sorry. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 11:03 AM |
os.clock()
Return CPU time since Lua started in seconds.
> = os.clock() 11056.989
os.date([format [, time]])
Return formatted date string, or table of time information. The format string has the same format as the C strftime() function.
TODO: insert info, examples and links to strftime() List all params at http://www.cplusplus.com/reference/clibrary/ctime/strftime/
Simple example:
> = os.date("%d.%m.%Y") 06.10.2012 If the format string is "*t" a table is returned containing the time information, e.g,
> table.foreach(os.date('*t'), print) hour 14 min 36 wday 1 year 2003 yday 124 month 5 sec 33 day 4 isdst true Above example using pairs() method:
> for k, v in pairs(os.date("*t")) do print(k, v) end year 2012 day 1 min 54 wday 4 month 8 isdst true yday 214 sec 39 hour 14 If the format is preceeded by "!" the time is converted to Coordinated Universal Time, e.g.,
> table.foreach(os.date('!*t'), print) hour 21 min 36 wday 1 year 2003 yday 124 month 5 sec 42 day 4 isdst false Above example using pairs() method:
> for k, v in pairs(os.date("!*t")) do print(k, v) end year 2012 day 1 min 58 wday 4 month 8 isdst false yday 214 sec 39 hour 12 os.date() returns a string in the format MM/DD/YY HH:MM:SS.
> print(os.date()) 08/16/05 10:22:32 Nowadays os.date() returns a string in different format:
> = os.date() Wed Aug 1 15:00:47 2012 |
|
|
| Report Abuse |
|
|
| |
|
777MrEpic
|
  |
| Joined: 17 Oct 2012 |
| Total Posts: 3998 |
|
|
| 11 Jun 2013 12:10 PM |
@KimJong Thanks man, now I can make epic scripts! |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 12:12 PM |
Ever heard of the magical thing called PiL? Programming in Lua?
That online manual about Lua? That tells you everything you need to know? And more? |
|
|
| Report Abuse |
|
|
adoman
|
  |
| Joined: 01 Sep 2010 |
| Total Posts: 306 |
|
|
| 25 Oct 2015 07:36 PM |
THIS IS ALL WRONG. IT IS STOLEN FROM:
http://lua-users.org/wiki/OsLibraryTutorial
THAT WEBSITE AND NONE OF IT WORKS
DON'T BOTHER USING IT! |
|
|
| Report Abuse |
|
|
bubblas
|
  |
| Joined: 15 Aug 2010 |
| Total Posts: 9 |
|
|
| 10 Jul 2016 10:42 PM |
I know this is an old post but, for everyone in the future reading this, here is the os.time wiki article: http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions#os.time |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 10 Jul 2016 10:43 PM |
os date and clock cant be used on roblox.
- Isosta |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2016 10:45 PM |
At least someone bumped with something useful. That doesn't often happen. Ask AbstractMadness, who recently bumped a couple of threads for his enjoyment.
The only problem is, there is enough data on this topic to help anyone who searches for it. The only reason new threads crop up on stuff like this is they either don't search it, don't understand the wiki, or can't think of how to word it.
|
|
|
| Report Abuse |
|
|
|
| 10 Jul 2016 11:58 PM |
| RIP 2 amazing people (As8D and LuaWeaver) from this forum :( |
|
|
| Report Abuse |
|
|
kylerzong
|
  |
| Joined: 06 Aug 2011 |
| Total Posts: 659 |
|
| |
|
Sluethen
|
  |
| Joined: 16 Nov 2015 |
| Total Posts: 6 |
|
|
| 18 Nov 2017 04:48 PM |
| This helped me alot! Thanks m8. And yes it does work I just tested it ;3 |
|
|
| Report Abuse |
|
|