This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160 > AT+CCLK time difference 2hours

Dear Team,

why is that the command "AT+CCLK" returns time with 2hours of difference? How should one compensate?

AT+CCLK?
+CCLK: "19/07/19,19:57:30+08"
OK

AT+CCLK?
+CCLK: "19/07/19,19:57:58+08"
OK

// current local time is: 21:59 now 

thank you and best

Oleh

  • Hi.

    The AT+CCLK? returns GMT time, and the difference to local time in quarters of an hour.

    If you divide your difference (8) by 4 you get 2 hours.

    Best regards,

    Didrik

  • Hi Didrik,

    is there any nrf API (or planed) to retrieve this info?

    thank you!

    Best

    Oleh

  • Hi.

    You can use the modem_info library to get the time, as well as other information from the modem.

    Best regards,

    Didrik

  • I knew that! :) you guys simply rock!! :)

    thank you!

  • Hi Didrik,

    I have cloned the head from git (2019-11-04), made a sample app, but the AT CMD = AT+CCLK does not return the date-time.

    Nor it returns from the at-client. 

    Am I missing something?

    Here is the log:

    app__modem_init_and_connect [614] > LTE connection time: 149571.
    app__post_init_checkpoint [798] > enter
    app__post_init_checkpoint [805] > FOTA succeeded. Boot image is confirmed!
    modem_info_string_get [445] > at cmd: AT%XCBAND=?
    modem_info_string_get [463] > parsed at cmd: AT%XCBAND=?
    modem_info_string_get [445] > at cmd: AT+CGDCONT?
    modem_info_string_get [463] > parsed at cmd: AT+CGDCONT?
    modem_info_string_get [445] > at cmd: AT+COPS?
    modem_info_string_get [463] > parsed at cmd: AT+COPS?
    modem_info_string_get [445] > at cmd: AT+CEREG?
    modem_info_string_get [463] > parsed at cmd: AT+CEREG?
    modem_info_string_get [445] > at cmd: AT+CEREG?
    modem_info_string_get [463] > parsed at cmd: AT+CEREG?
    modem_info_string_get [445] > at cmd: AT+CCLK?
    modem_info_string_get [463] > parsed at cmd: AT+CCLK?
    modem_info_string_get [445] > at cmd: AT+CRSM=176,12258,0,0,10
    modem_info_string_get [463] > parsed at cmd: AT+CRSM=176,12258,0,0,10
    modem_info_string_get [445] > at cmd: AT+CIMI
    modem_info_string_get [463] > parsed at cmd: AT+CIMI
    modem_info_string_get [445] > at cmd: AT+CGMR
    modem_info_string_get [463] > parsed at cmd: AT+CGMR
    modem_info_string_get [445] > at cmd: AT+CGSN
    modem_info_string_get [463] > parsed at cmd: AT+CGSN
    app__handler__device_status_send [465] >

    board: nrf9160_innblue21 app_version: v1.1.0-rc1-28-g32667fe8c36b app_name: innblue_test
    modem fw: mfw_nrf9160_1.0.1 modem battery: 3344
    current band: 8 operator: 26201 cell id: 537002327 mcc: 262 mnc: 1 area_code 54050
    IP: 100.113.84.3
    current time: 15/02/01,00:02:32

    and AT-CLient:

    AT+CCLK
    [00:05:55.637,115] [1B][1;31m<err> at_host: Error while processing AT command: -8[1B][0m
    ERROR
    AT+CCLK?
    +CCLK: "15/02/01,00:05:58"
    OK

Related