kernel-small-debug-shell-net-ntpdate.md 2.7 KB
Newer Older
D
duangavin123 已提交
1
# ntpdate<a name="EN-US_TOPIC_0000001179965859"></a>
W
wenjun 已提交
2

N
NEEN 已提交
3 4
-   [Command Function](#section38494293815)
-   [Syntax](#section5503114413387)
D
duangavin123 已提交
5
-   [Parameters](#section136934472383)
N
NEEN 已提交
6 7 8 9
-   [Usage](#section121401651173816)
-   [Example](#section3431554203811)
-   [Output](#section18638194610115)

W
wenjun 已提交
10 11 12 13 14 15 16 17
## Command Function<a name="section38494293815"></a>

This command is used to synchronize system time from the server.

## Syntax<a name="section5503114413387"></a>

ntpdate \[_SERVER\_IP1_\] \[_SERVER\_IP2_\]...

D
duangavin123 已提交
18
## Parameters<a name="section136934472383"></a>
W
wenjun 已提交
19

D
duangavin123 已提交
20
**Table  1**  Parameter description
W
wenjun 已提交
21 22 23 24 25 26 27 28 29 30 31 32

<a name="table2616mcpsimp"></a>
<table><thead align="left"><tr id="row2622mcpsimp"><th class="cellrowborder" valign="top" width="20.79%" id="mcps1.2.4.1.1"><p id="p2624mcpsimp"><a name="p2624mcpsimp"></a><a name="p2624mcpsimp"></a><strong id="b156978804711722"><a name="b156978804711722"></a><a name="b156978804711722"></a>Parameter</strong></p>
</th>
<th class="cellrowborder" valign="top" width="52.480000000000004%" id="mcps1.2.4.1.2"><p id="p2626mcpsimp"><a name="p2626mcpsimp"></a><a name="p2626mcpsimp"></a><strong id="b53501572310"><a name="b53501572310"></a><a name="b53501572310"></a>Description</strong></p>
</th>
<th class="cellrowborder" valign="top" width="26.729999999999997%" id="mcps1.2.4.1.3"><p id="p2628mcpsimp"><a name="p2628mcpsimp"></a><a name="p2628mcpsimp"></a><strong id="b88462564511722"><a name="b88462564511722"></a><a name="b88462564511722"></a>Value Range</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="row2629mcpsimp"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.2.4.1.1 "><p id="p2631mcpsimp"><a name="p2631mcpsimp"></a><a name="p2631mcpsimp"></a>SERVER_IP</p>
</td>
D
duangavin123 已提交
33
<td class="cellrowborder" valign="top" width="52.480000000000004%" headers="mcps1.2.4.1.2 "><p id="p2633mcpsimp"><a name="p2633mcpsimp"></a><a name="p2633mcpsimp"></a>Specifies the IP address of the NTP server.</p>
W
wenjun 已提交
34 35 36 37 38 39 40 41 42 43 44 45 46
</td>
<td class="cellrowborder" valign="top" width="26.729999999999997%" headers="mcps1.2.4.1.3 "><p id="entry2634mcpsimpp0"><a name="entry2634mcpsimpp0"></a><a name="entry2634mcpsimpp0"></a>N/A</p>
</td>
</tr>
</tbody>
</table>

## Usage<a name="section121401651173816"></a>

Run the  **ntpdate **\[_SERVER\_IP1_\] \[_SERVER\_IP2_\]... command.  **ntpdate**  obtains and displays the time of the first server with a valid IP address.

## Example<a name="section3431554203811"></a>

D
duangavin123 已提交
47
Run  **ntpdate 192.168.1.3 **to update the system time.
W
wenjun 已提交
48 49 50 51 52 53 54 55

## Output<a name="section18638194610115"></a>

```
OHOS # ntpdate 192.168.1.3
time server 192.168.1.3: Mon Jun 13 09:24:25 2016
```

D
duangavin123 已提交
56
If the time zone of the board is different from that of the server, the displayed time may be several hours different from the obtained server time.
W
wenjun 已提交
57