BIS_fnc_calculateDateTime

From Bohemia Interactive Community
(Redirected from BIS fnc CalculateDateTime)
Jump to navigation Jump to search
Introduced with Arma 3 version 1.861.86
Hover & click on the images for descriptions

Description

Description:
Returns the end datetime if an offset is passed, or the offset between start and end dates.

Syntax

Syntax:
[startDate, endDateOrOffset, timeUnit] call BIS_fnc_CalculateDateTime
Parameters:
startDate: Array in Date format - (Optional, default date)
endDateOrOffset: Array in Date format or Number - (Optional, default date) either the end date of the period to calculate, or time in seconds from startDate
timeUnit: String - (Optional, default "s") one of:
  • "s" - seconds
  • "m" - minutes
  • "h" - hours
  • "d" - days
Return Value:
Date or Number - Date if endDateOrOffset is a Number, Number is endDateOrOffset is a Date

Examples

Example 1:
[date, 3600] call BIS_fnc_CalculateDateTime; // returns date in 3600 seconds (60min, 1h) Example: [date, 60, "m"] call BIS_fnc_CalculateDateTime; // returns date in 60 minutes (1h) Example: [[2035,8,28,11,55], [2035,8,29,11,55], "h"] call BIS_fnc_CalculateDateTime; // returns 24

Additional Information

Execution:
call
See also:
datesetDateBIS_fnc_setDate

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.