README.rst
1.. zephyr:code-sample:: sntp-client
2 :name: SNTP client
3 :relevant-api: bsd_sockets sntp
4
5 Use SNTP to get the current time from the host.
6
7Overview
8********
9
10This sample is a simple SNTP client showing how to retrieve the current
11time in seconds since 1st January 1970.
12
13This demo assumes that the platform of choice has networking support,
14some adjustments to the configuration may be needed. It also assumes
15SNTP server is running on the host.
16
17Building and Running
18********************
19
20When the application runs, it issues an SNTP request to the host and waits
21for a response. When the response is received, the current epoch time, in
22seconds, as well as the status code of the response (0 on success), is
23printed.
24
25See the `net-tools`_ project for more details.
26
27This sample can be built and executed on QEMU or native_sim board as
28described in :ref:`networking_with_qemu`.
29
30.. _`net-tools`: https://github.com/zephyrproject-rtos/net-tools
31
32Wi-Fi
33=====
34
35The IPv4 Wi-Fi support can be enabled in the sample with
36:ref:`Wi-Fi snippet <snippet-wifi-ipv4>`.
37