# setTime (Client)

> Changes the game time on this client. The clock keeps running from there.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: World and weather
- **URL**: https://wiki.mymp.gg/en/setTime-client
- **Counterpart**: Also exists on the server, with its own implementation: [setTime (Server)](https://wiki.mymp.gg/en/setTime-server.md)

## Syntax

```lua
bool setTime(int hour [, int minute = 0])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `hour` | `int` | The hour. |
| `minute` | `int` | The minutes. *(default: `0`)* |

## Returns

`true` once the time is set.

Values past the day wrap around: `setTime(25)` is 1:00 and `setTime(-1)` is 23:00.

## Example

```lua
addCommandHandler("noon", function()
    setTime(12, 0)
end)
```

## See also

- [getTime (Client)](https://wiki.mymp.gg/en/getTime-client.md): Returns the game time on this client.
- [setTimeFrozen (Client)](https://wiki.mymp.gg/en/setTimeFrozen.md): Freezes or unfreezes the game clock on this client. While frozen the time does not advance, but setTime still changes it.
- [setMinuteDuration (Client)](https://wiki.mymp.gg/en/setMinuteDuration-client.md): Sets how much real time one game minute lasts on this client.
