  struct tm get_time(){
    time_t rawtime;
    time(&rawtime);
  
    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);
  }
  
  void safety_setter_thread() {
    LOGD("Starting safety setter thread");
    // diagnostic only is the default, needed for VIN query
    panda->set_safety_model(cereal::CarParams::SafetyModel::ELM327);
 
</s> remove struct tm get_time(){
  time_t rawtime;
  time(&rawtime);
 </s> add  </s> remove     if (!time_valid(sys_time) && time_valid(rtc_time)) {
 </s> add     if (!util::time_valid(sys_time) && util::time_valid(rtc_time)) { </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();
  struct tm get_time(){
    time_t rawtime;
    time(&rawtime);
  











  
  void safety_setter_thread() {
    LOGD("Starting safety setter thread");
    // diagnostic only is the default, needed for VIN query
    panda->set_safety_model(cereal::CarParams::SafetyModel::ELM327);
keep keep keep keep replace replace replace replace replace replace replace replace 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