BIS fnc calculateDateTime: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 20: | Line 20: | ||
* "d" - days | * "d" - days | ||
|r1= [[Date]] or [[Number]] | |r1= [[Date]] or [[Number]] | ||
* [[Date]] if ''endDateOrOffset'' is a [[Number]] | |||
* [[Number]] is ''endDateOrOffset'' is a [[Date]] | |||
|x1= < | |x1= <sqf> | ||
[date, 3600] call BIS_fnc_calculateDateTime; // returns date in 3600 seconds (60min, 1h) | |||
[date, 60, "m"] call BIS_fnc_calculateDateTime; // returns date in 60 minutes (1h) | |||
[[2035,8,28,11,55], [2035,8,29,11,55], "h"] call BIS_fnc_calculateDateTime; // returns 24 | |||
</sqf> | |||
|seealso= [[date]] [[setDate]], [[BIS_fnc_setDate]] | |seealso= [[date]] [[setDate]], [[BIS_fnc_setDate]] | ||
}} | }} |
Revision as of 19:42, 3 May 2022
Description
- Description:
- Returns the end datetime if an offset is passed, or the offset between start and end dates.
- Execution:
- call
- Groups:
- Environment
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
Examples
- Example 1:
Additional Information
- See also:
- date setDateBIS_fnc_setDate
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note