Začíname už za

Synchronizácia času

Created by Miroslav Biňas / mirek

## What's the Time?
## RTC > A real-time clock (RTC) is a computer clock (most often in the form of an integrated circuit) that keeps track of the current time. > ([Wikipedia](https://en.wikipedia.org/wiki/Real-time_clock))
[![Motherboard](/iot1/images/motherboard.jpeg)](https://www.alza.sk/asus-prime-h310m-r-r2-0-d5535927.htm)
![RTC Module](/iot1/images/rtc.module.jpg)
## Time Epoch Unix port uses standard for POSIX systems epoch of `1970-01-01 00:00:00 UTC`. However, embedded ports use epoch of `2000-01-01 00:00:00 UTC`.
## Notable Epoch Dates | epoch | usages | | ---------- | ------------------------------------------------ | | 0.jan.1 BC | MATLAB | | 0.jan.1900 | MS Excel, IBM Lotus Notes 1, 2, 3 | | 6.jan.1980 | GPS | | 1.jan.2000 | microcontrollers, *PostgreSQL*, *ZigBee UTCTime* |
## [`utime`](http://docs.micropython.org/en/latest/library/utime.html) > The time module provides functions for getting the current time and date, measuring time intervals, and for delays.
## [`gmtime([secs])`](https://docs.micropython.org/en/latest/library/time.html#time.gmtime) * in module `time`/`utime` * convert the time `secs` expressed in seconds since the *Epoch* into an 8-tuple * if `secs` is not provided or `None`, then the current time from the RTC is used
## [`time([secs])`](https://docs.micropython.org/en/latest/library/time.html#time.time) * in module `time`/`utime` * returns the number of seconds, as an integer, since the *Epoch*
## NTP > The Network Time Protocol (NTP) is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks. > ([Wikipedia](https://en.wikipedia.org/wiki/Network_Time_Protocol))
![NTP Servers and Clients](/iot1/images/ntp.servers.and.clients.svg)
## [chrony](https://chrony.tuxfamily.org)
## [www.ntppool.org](https://www.ntppool.org)
## `ntptime`
## UTC Coordinated Universal Time
![Prime Meridian](/iot1/images/prime.meridian.jpg) notes: * https://www.space.fm/astronomy/earthmoonsun/primemeridian.html
[![Prime Meridian](/iot1/images/stand.on.prime.meridian.line.jpg)](https://www.rmg.co.uk/royal-observatory/attractions/stand-on-prime-meridian-line)
![Mapa časových pásiem](/iot1/images/world.time.zones.map.png)
![Šírka jedného časového pásma](/iot1/images/timezones-width.of.timezone.png)
## Named Time Zones | short | name | UTC | | ----- | --------------------- | ------ | | CET | Central European Time | +01:00 | | PST | Pacific Standard Time | -08:00 | | MSK | Moscow Standard Time | +03:00 |
## Fun Facts
## Timezones Support in MicroPython?
[![XKCD: ISO 8601](https://imgs.xkcd.com/comics/iso_8601.png)](https://imgs.xkcd.com/comics/iso_8601.png)
`2022-03-20T12:34:56Z`
`2022-03-20T12:34:56+01:00`
[![](/iot1/images/radio-controlled-clock.jpg)](https://bigtimeclocks.biz/blogs/news/how-a-radio-controlled-clock-works) notes: * https://bigtimeclocks.biz/blogs/news/how-a-radio-controlled-clock-works
## Questions?
![](https://s3.amazonaws.com/nightjarprod/content/uploads/sites/344/2025/12/19183736/tzGY49kseSE9QAKk47uuDGwnSCu1.jpg)