# ntp **Repository Path**: jdhxyy/ntp ## Basic Information - **Project Name**: ntp - **Description**: 基于Golang编写的天泽物联网的ntp服务 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-26 - **Last Updated**: 2021-04-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ntp ## 介绍 基于Golang编写,在海萤物联网提供校时服务。 本机地址是: ```text 0x41000005 ``` ## 服务 服务号|服务 ---|--- 1|读取时间1 2|读取时间2.返回的是结构体 ### 读取时间服务1 - 请求:空或者带符号的1个字节。 当请求为空时,则默认为读取的是北京时间(时区8)。 也可以带1个字节表示时区号。这个字节是有符号的int8。 小技巧,可以使用0x100减去正值即负值。比如8对应的无符号数是0x100-8=248。 - 应答:当前时间的字符串 当前时间字符串的格式:2006-01-02 15:04:05 -0700 MST ### 读取时间服务2.返回的是结构体 - 请求:格式与读取时间服务1一致 - 应答: ```c struct { // 时区 uint8 TimeZone uint16 Year uint8 Month uint8 Day uint8 Hour uint8 Minute uint8 Second // 星期 uint8 Weekday } ```