Difference between revisions of "MIST getDate"

From DCS World Wiki - Hoggitworld.com
(Created page with "{{Mission Scripting |fName= mist.time.getDate |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 val...")
 
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 the current date of the mission.
+
|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
  
 
|rtnType= table
 
|rtnType= table
Line 55: Line 55:
  
 
|example= <code>
 
|example= <code>
   local date = mist.time.getDate()
+
   local date = mist.time.getDate(timer.getAbsTime())
 
   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")

Revision as of 15:50, 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 nil and logs an error
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(timer.getAbsTime())
 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