From Bohemia Interactive Community
Hover & click on the images for description
Description
- Description:
- Convert a date to a float number, based on Jan 1st 00:00:00 = 0 and Dec 31st 23:59:59 = 1. The same day and time in leap year will be different after 28th of February and 23:59 on 31st of December will be 1.00274.
This is how this command works. The 365 days of the year are presented in range 0...1. So each day will be:
In a leap year there are 366 days, so the range will increase by 1 day:
In short, in a normal year the command returns in range 0...1 in a leap year it will return in range 0...1.00274.
- Groups:
- Environment
Syntax
- Syntax:
- dateToNumber date
- Parameters:
- date: Array - array in date format
- Return Value:
- Number
Examples
- Example 1:
- Example 2:
- Example 3:
- Calculate days from 1/1/1970:
Additional Information
- See also:
- date dayTime time numberToDate
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