> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-wedding/time-zones.md).

# Time and Time Zones

How the RedM Wedding & Marriage System handles real time: ceremony hours in server time, every time shown in each player's own time zone, 12 and 24 hour clocks, and pinning the server's time zone.

Ceremonies are booked in **real time**, not game time. A wedding at 18:00 happens at 18:00 on the clock on the wall.

Players on one server can live in different time zones. The script handles that for them: the hours are set once, in server time, and each player sees them converted to their own computer's clock.

## An example

The server runs in Turkey (UTC+3) and a ceremony hour starts at **18:00** server time.

| Player                        | Sees the ceremony at |
| ----------------------------- | -------------------- |
| In Istanbul (UTC+3)           | 18:00                |
| In London (UTC+1 in summer)   | 16:00                |
| In New York (UTC-4 in summer) | 11:00 AM             |

All three turn up at the same moment.

## Where times appear

Every time the script shows is converted: the booking calendar and its confirmation, the booked ceremony in the marriage records, the ceremony on an invitation's envelope, notifications such as **Ceremony booked** or *The court will hear it on...*, and the divorce hearing.

When a player's clock differs from the server's, the booking calendar says so, for example *Hours are set in server time (UTC+3) and shown in your time zone, Europe/London.* Each hour also shows its server time.

## The player's settings

Under **Settings** in the marriage records:

| Setting                   | Effect                                                                                             |
| ------------------------- | -------------------------------------------------------------------------------------------------- |
| **Clock**                 | **Automatic** follows the player's computer. Or force **12-hour** (6:00 PM) or **24-hour** (18:00) |
| **Also show server time** | Shows the server time next to the player's own. On by default                                      |

The player's time zone is read from their own computer. If their clock is set wrong, the times they see are wrong in the same way.

## Server time

Server time decides three things: which hours the ceremony slots start at, which calendar day a booking falls on, and when anniversaries come round.

```lua
Config.ServerUtcOffset = nil
```

With `nil`, server time is the clock of the machine the server runs on.

Set a UTC offset in hours to pin it instead:

```lua
Config.ServerUtcOffset = 3      -- Turkey, UTC+3
Config.ServerUtcOffset = -5     -- US Eastern, UTC-5
Config.ServerUtcOffset = 5.5    -- India, UTC+5:30
```

Pin it if your server may move to a machine in another time zone, such as a rented host abroad. Otherwise every ceremony hour would shift with the move. A pinned offset does not change for daylight saving time.

{% hint style="info" %}
Ceremony hours are fixed in server time. Pick hours that suit most of your players, for example the evening in the time zone most of them live in. See [Ceremony hours](/script-documentation/cas-wedding/booking.md#ceremony-hours).
{% endhint %}

## The year shown

Real time decides the day and the hour. The year on documents is set separately, so certificates and decrees read like the 1890s:

```lua
Config.DisplayYear = 1899
```

Set it to `nil` to show the real year.
