Core Help Root: Objects: Time


$time is a general utility object for handling time values that don't deal specifically with the game's time system. Those issues are covered by $world_time.

Methods

.format(format, time) native
Given a format string, format and a time in seconds, time, returns the formatted time string. For now, revert to a man page for strftime for help on the format string.
.elapsed(time, [flag])
Given a time time, it returns the time between now and then. flag controls how it is formatted. 'long will return it in the manner of .to_english(), while the default value, 'stopwatch, will return it as HH:MM:SS
.dhms(secs, [long])
Given a time, time, it returns the number of days OR hours OR minutes OR seconds, which ever unit fits roughly. If the flag long is true, it uses the full name of the unit of time.
.from_english(string)
Returns the number of seconds represented by the english description of time in the argument string. This just defers to $world_time.from_english().
.to_english(time, [reftime])
Given a number of seconds, time, and an optional reference time, reftime, which defaults to the current time, will return a string representing the time in English. This method attempts to take the varying number of days in a month and also leap years into account. NOTE: The results of this method when fed into .from_english(), will NOT return the original integer due to the lack of compensation for the things this method accounts for: the leap years, number of days in a month, etc.


Colors | Trie | List Library | has_text | mutex | Heap | Weather System | Math Library | Integer | Data Lib | Object Lib | Help Node | Code Lib | Generic Map | Scrabble | World Time | Time | Robot | Native Function Reference | Complex Number Library | Bytecode Docs | motd | Mail List | Float | Collective | libraries | social_ui


the Cold Dark