MIST getDate: Difference between revisions

From DCS World Wiki - Hoggitworld.com
No edit summary
m Reverted edits by Acidictadpole (talk) to last revision by Grimes
 
Line 5: Line 5:
|vNum = Mist 3.7
|vNum = Mist 3.7


|desc= Returns a table formatted as {d = day, m = month, y = year} of a given time in seconds. If no time value is passed the function returns nil and logs an error
|desc= Returns a table formatted as {d = day, m = month, y = year} of a given time in seconds. If no time value is passed the function returns the current date of the mission.


|rtnType= table
|rtnType= table
Line 55: Line 55:


|example= <code>
|example= <code>
   local date = mist.time.getDate(timer.getAbsTime())
   local date = mist.time.getDate()
   if date.d == 8 and date.m == 9 then
   if date.d == 8 and date.m == 9 then
     env.info("Happy Birthday mom")
     env.info("Happy Birthday mom")

Latest revision as of 15:52, 4 January 2019


mist.time.getDate

Added with: Mist 3.7
Description
Returns a table formatted as {d = day, m = month, y = year} of a given time in seconds. If no time value is passed the function returns the current date of the mission.
Syntax
table mist.time.getDate( number time )
Valid Input Values:
93600
Return value:
table
Return example:
{d = 2, m = 1, y = 2011}
Usage Examples:
 local date = mist.time.getDate()
 if date.d == 8 and date.m == 9 then
   env.info("Happy Birthday mom")
 end

Notes:
Not a replacement for Tinder.
Related Functions
getDate, getDHMS, convertToSec, milToGame

Scripting Engine

MIST Root Page