移远EC20 获取基站时间来给终端对时

移远EC20 获取基站时间来给终端对时

第一节 EC20 手册说明

AT +CCLK 
该命令用来获取模组的系统时间。
<time> String type value, format is “yy/MM/dd,hh:mm:ss±zz”, indicate year (two last digits), month, 
day, hour, minutes, seconds and time zone (indicates the difference, expressed in quarters 
of an hour, between the local time and GMT; range -48...+56). E.g. May 6th, 1994, 22:10:00 
GMT+2 hours equals to “94/05/06,22:10:00+08”.
Example 
AT+CCLK? //Query the local time
+CCLK: “08/01/04,00:19:43+00”
OK
AT+CTZU  automatic time zone update
Set command enables and disables automatic time zone update via NITZ. The configuration is stored to 
NV automatically.
<onoff> Integer type, indicates the mode of automatic time zone update
 0 Disable automatic time zone update via NITZ.
1 Enable automatic time zone update via NITZ

测试结果

0142 串口A: ASCII字符: AT+CTZU=1  AT+CTZU=1   OK  
0143 串口A: ASCII字符: AT+CCLK?  AT+CCLK?   +CCLK: "20/03/19,07:15:16+32"  OK 
我们可以看到时间已经拿到,后面的+32的意思是由与按1/4分区时来设计。32 其实等于8,也就是东8区