Use rtc_get_time
Use strncpy instead of memcpy