GetRealTime: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Server client function}} This function gets the real server time and returns it in a table ==Syntax== <syntaxhighlight lang="lua">table getCTime()</syntaxhighlight> ===Returns=== Returns a ''table'' o...) |
No edit summary |
||
Line 52: | Line 52: | ||
==Example== | ==Example== | ||
This example outputs local time (server or client, where ever it was triggered) as hours and minutes | |||
This example | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function showtime () | function showtime () | ||
Line 62: | Line 61: | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Utility functions}} | {{Utility functions}} |
Revision as of 13:00, 28 November 2007
This function gets the real server time and returns it in a table
Syntax
table getCTime()
Returns
Returns a table of substrings with different time format, false otherwise.
Member | Meaning | Range |
tm_sec | seconds after the minute | 0-61* |
tm_min | minutes after the hour | 0-59 |
tm_hour | hours since midnight | 0-23 |
tm_mday | day of the month | 1-31 |
tm_mon | months since January | 0-11 |
tm_year | years since 1900 | |
tm_wday | days since Sunday | 0-6 |
tm_yday | days since January 1 | 0-365 |
tm_isdst | Daylight Saving Time flag |
- tm_sec is generally 0-59. Extra range to accommodate for leap seconds in certain systems.
Example
This example outputs local time (server or client, where ever it was triggered) as hours and minutes
function showtime () local time = getCTime() local hours = time.tm_hour local minutes = time.tm_min outputChatBox ( "Local Time: "..hours..":"..minutes ) end
See Also
- addDebugHook
- base64Decode
- base64Encode
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace