---
name: "sunOrMoon"
type: command
status: ok
groups: ["Environment"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/sunOrMoon
revid: 363669
updated: 2024-04-14T20:21:37Z
---

# sunOrMoon

*Command · Environment · Arma 3 v0.50 · introduced in Arma 2: Operation Arrowhead v1.62*

## Description

| Time | [sunOrMoon](../commands/sunOrMoon.md) |
|---|---|
| 12:00 | 1 |
| (...) | 1 |
| 18:39 | 0.911201 |
| 18:42 | 0.576303 |
| 18:45 | 0.240862 |
| 18:48 | 0 |
| (...) | 0 |
| 06:00 | 0.695308 |
| 06:03 | 0.739519 |
| 06:09 | 1 |
| (...) | 1 |

Returns the moon to sun transition state in range 0..1.

The return value is either 0 or 1 most of the time, the in-between values only returned during a few minutes in the morning and in the evening, depending on the [date](../commands/date.md), and could be similar to shown here:

## Syntax

```sqf
sunOrMoon
```

**Returns:** [Number](../topics/Number.md) - 0 for night (moon), 1 for day (sun)

## Examples

### Example 1

```sqf
private _transitionState = sunOrMoon;
```

## See also

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

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