  std::atomic<bool> safety_setter_thread_running(false);
  std::atomic<bool> ignition(false);
  
  ExitHandler do_exit;
  struct tm get_time(){
    time_t rawtime;
    time(&rawtime);
  
    struct tm sys_time;
    gmtime_r(&rawtime, &sys_time);
  
    return sys_time;
 
</s> remove   struct tm sys_time;
  gmtime_r(&rawtime, &sys_time);

  return sys_time;
}

bool time_valid(struct tm sys_time){
  int year = 1900 + sys_time.tm_year;
  int month = 1 + sys_time.tm_mon;
  return (year > 2020) || (year == 2020 && month >= 10);
}
 </s> add  </s> remove     struct tm sys_time = get_time();
 </s> add     struct tm sys_time = util::get_time(); </s> remove       struct tm sys_time = get_time();
 </s> add       struct tm sys_time = util::get_time(); </s> remove     if (!time_valid(sys_time) && time_valid(rtc_time)) {
 </s> add     if (!util::time_valid(sys_time) && util::time_valid(rtc_time)) {
  std::atomic<bool> safety_setter_thread_running(false);
  std::atomic<bool> ignition(false);
  
  ExitHandler do_exit;



  
    struct tm sys_time;
    gmtime_r(&rawtime, &sys_time);
  
    return sys_time;
keep keep keep keep replace replace replace keep keep keep keep keep
 Store almanac on ublox poweroff (#20967)

* Store almanac on ublox poweroff

* send current UTC time

* move message building to ublox_msg.h 
selfdrive/boardd/boardd.cc