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

How to get UTC into ble_date_time

Hi,

I am trying to get date and time on my nrf51822 but struggling a bit. I would like the nrf to receive the time over BLE and then increment it internally using the RTC. When the nrf next connects to another device it should automatically update the time again in case of power off, etc.

I would also like to be able to get the time in ble_date_time format so I can pull out months, days, hours, minutes, etc.

I am using an nrf51822 with the s110 softdevice.

If anyone could point me in the right direction I would be very grateful.

Parents
  • I have looked at that and understand how the RTC module is working. However, and forgive me if I am being rather ignorant here, I cannot see how you set say RTC2 to know the current time.

    My application basically needs to store the current time & date when an event has finished. The soft device uses RTC0, my application timers use RTC1 so I would like RTC2 to keep track of the time and then store it (using pstorage) when requested. Apologies again if I am missing some blindingly obvious point.

Reply
  • I have looked at that and understand how the RTC module is working. However, and forgive me if I am being rather ignorant here, I cannot see how you set say RTC2 to know the current time.

    My application basically needs to store the current time & date when an event has finished. The soft device uses RTC0, my application timers use RTC1 so I would like RTC2 to keep track of the time and then store it (using pstorage) when requested. Apologies again if I am missing some blindingly obvious point.

Children
No Data
Related