Time - truemedian/Discordia GitHub Wiki
Represents a length of time and provides utilities for converting to and from different formats with millisecond precision.
fromWeeks
fromDays
fromHours
fromMinutes
fromSeconds
fromMilliseconds
fromTable
toString
toWeeks
toDays
toHours
toMinutes
toSeconds
toMilliseconds
toTable
Constructs a new Time object from a value interpreted as weeks, where a week is equal to 7 days.
Name Type t number Returns: Time
Constructs a new Time object from a value interpreted as days, where a day is equal to 24 hours.
Name Type t number Returns: Time
Constructs a new Time object from a value interpreted as hours, where an hour is equal to 60 minutes.
Name Type t number Returns: Time
Constructs a new Time object from a value interpreted as minutes, where a minute is equal to 60 seconds.
Name Type t number Returns: Time
Constructs a new Time object from a value interpreted as seconds, where a second is equal to 1000 milliseconds.
Name Type t number Returns: Time
Constructs a new Time object from a value interpreted as milliseconds, the base unit represented.
Name Type t number Returns: Time
Constructs a new Time object from a table of time values where the keys are defined in the constructors above (eg:
weeks
,days
,hours
).
Name Type t table Returns: Time
Returns a string from the normalized time values that can be used to represent the time object in a string form.
Returns: string
Returns the total number of weeks that the time object represents.
Returns: number
Returns the total number of days that the time object represents.
Returns: number
Returns the total number of hours that the time object represents.
Returns: number
Returns the total number of minutes that the time object represents.
Returns: number
Returns the total number of seconds that the time object represents.
Returns: number
Returns the total number of milliseconds that the time object represents.
Returns: number
Returns a table of normalized time values that can be used to represent the time object in a more human-readable form.
Returns: number