BIS fnc calculateDateTime: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page filling)
m (Text replacement - "BIS_fnc_CalculateDateTime" to "BIS_fnc_calculateDateTime")
Line 8: Line 8:
Returns the end datetime if an offset is passed, or the offset between start and end dates. |Description=
Returns the end datetime if an offset is passed, or the offset between start and end dates. |Description=


| [startDate, endDateOrOffset, timeUnit] call [[BIS_fnc_CalculateDateTime]] |Syntax=
| [startDate, endDateOrOffset, timeUnit] call [[BIS_fnc_calculateDateTime]] |Syntax=


|p1= startDate: [[Array]] in [[Date]] format - (Optional, default [[date]]) |Parameter 1=
|p1= startDate: [[Array]] in [[Date]] format - (Optional, default [[date]]) |Parameter 1=
Line 22: Line 22:
| [[Date]] or [[Number]] - [[Date]] if ''endDateOrOffset'' is a [[Number]], [[Number]] is ''endDateOrOffset'' is a [[Date]] |Return value=
| [[Date]] or [[Number]] - [[Date]] if ''endDateOrOffset'' is a [[Number]], [[Number]] is ''endDateOrOffset'' is a [[Date]] |Return value=


|x1= <code>[<nowiki/>[[date]], 3600] [[call]] [[BIS_fnc_CalculateDateTime]]; {{cc|returns date in 3600 seconds (60min, 1h)}}
|x1= <code>[<nowiki/>[[date]], 3600] [[call]] [[BIS_fnc_calculateDateTime]]; {{cc|returns date in 3600 seconds (60min, 1h)}}
Example: [<nowiki/>[[date]], 60, "m"] [[call]] [[BIS_fnc_CalculateDateTime]]; {{cc|returns date in 60 minutes (1h)}}
Example: [<nowiki/>[[date]], 60, "m"] [[call]] [[BIS_fnc_calculateDateTime]]; {{cc|returns date in 60 minutes (1h)}}
Example: [<nowiki/>[2035,8,28,11,55], [2035,8,29,11,55], "h"] [[call]] [[BIS_fnc_CalculateDateTime]]; {{cc|returns 24}}</code> |Example 1=
Example: [<nowiki/>[2035,8,28,11,55], [2035,8,29,11,55], "h"] [[call]] [[BIS_fnc_calculateDateTime]]; {{cc|returns 24}}</code> |Example 1=


| [[date]], [[setDate]], [[BIS_fnc_setDate]] |See also=
| [[date]], [[setDate]], [[BIS_fnc_setDate]] |See also=

Revision as of 15:51, 9 October 2020

Hover & click on the images for description

Description

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

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

See also:
datesetDateBIS_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