---
title: "GetWorldTime | open.mp"
description: "获取当前世界时间。"
canonical: https://omp.itsneufox.com/zh-CN/docs/scripting/functions/GetWorldTime
language: zh-CN
---

# GetWorldTime

注意

这个函数是在omp v1.1.0.2612中添加的，在以前的版本中不起作用！

## 描述

获取服务器当前的全局世界时间。

## 示例

```c
SetWorldTime(12);

printf("当前世界时间：%d", GetWorldTime());
// 输出将为"当前世界时间：12"
```

## 相关函数

-   [SetWorldTime](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/SetWorldTime): 为所有玩家设置世界时间（精确到小时）
-   [SetPlayerTime](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/SetPlayerTime): 设置玩家独立时间显示
