# timedatectl

* [timedatectl](https://manpages.debian.org/bookworm/systemd/timedatectl.1.en.html) - Controlar la hora y la fecha del sistema.

Es muy importante establecer la zona horaria correcta en nuestro sistema, ya que de esto depende los procesos, registros y tareas que hacemos dentro de él. Aunque existen otras formas de cambiar tanto la hora, como la zona horaria, la mejor manera es hacerlo con `timedatectl`.

Para ver nuestra zona horaria actual basta con ejecutar `timedatectl` sin ninguna opción.

```bash
$ timedatectl
               Local time: Sat 2024-11-23 08:44:57 -05
           Universal time: Sat 2024-11-23 13:44:57 UTC
                 RTC time: Sat 2024-11-23 13:44:57
                Time zone: America/Bogota (-05, -0500)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
```

Como vemos en este ejemplo, me indica la hora local del sistema, la hora universal o [UTC](https://es.wikipedia.org/wiki/Tiempo_universal_coordinado), y la zona horaria en mi caso es America/Bogota. También es importante que el servicio [NTP](https://es.wikipedia.org/wiki/Network_Time_Protocol) esté activo.

Para ver una lista completa de las zonas horarias ejecuta `timedatectl list-timezones`, cuando encuentres tu zona horaria ejecuta:

```bash
$ sudo timedatectl set-timezone Zona/Ciudad
```

Si el servicio NTP no se encuentra activo, puede ejecutar:

```bash
$ sudo timedatectl set-ntp true
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yejokjanan.gitbook.io/aprendiendo-gnulinux/comandos-basicos/administracion/timedatectl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
