---
name: "moonPhase"
type: command
status: ok
groups: ["Environment"]
arma3_since: "1.58"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/moonPhase
revid: 377266
updated: 2026-01-02T06:34:11Z
---

# moonPhase

*Command · Environment · Arma 3 v1.58*

## Description

Returns the phase of the in-game Moon on the given date.
According to this command, the fullest Moon in Arma 3 at midnight is on `setDate [4804, 7, 13, 0, 0];`.
Use the Moon Phase Utility to find out a scenario date with desired moon.

## Syntax

```sqf
moonPhase date
```

**Parameters:**

- `date`: Date

**Returns:** [Number](../topics/Number.md) in 0..1 range - 0 = new Moon, 1 = full Moon

## Examples

### Example 1

```sqf
private _currentMoonPhase = moonPhase date;
```

### Example 2

```sqf
// Returns array of dates for given year when moon is at its fullest
fnc_fullMoonDates = 
{
    private _year = param [0, 2035];
    private ["_date", "_phase", "_fullMoonDate"];
    private _fullMoonPhase = 1;
    private _waxing = false;
    private _fullMoonDates = [];
    for "_i" from dateToNumber [_year, 1, 1, 0, 0] to dateToNumber [_year, 12, 31, 23, 59] step 1 / 365 do
    {
        _date = numberToDate [_year, _i];
        _phase = moonPhase _date;

        call
        {
            if (_phase > _fullMoonPhase) exitWith
            {
                _waxing = true;
                _fullMoonDate = _date;
            };

            if (_waxing) exitWith 
            {
                _waxing = false;
                _fullMoonDates pushBack _fullMoonDate;
            };
        };

        _fullMoonPhase = _phase;
    };

    _fullMoonDates;
};

//set random full moon date in year 1970
setDate selectRandom (1970 call fnc_fullMoonDates);
```

## See also

[moonIntensity](../commands/moonIntensity.md) · [sunOrMoon](../commands/sunOrMoon.md)

<sub>Source: [BI Community Wiki — moonPhase](https://community.bistudio.com/wiki/moonPhase) (revision 377266).</sub>
