Skip to content

Commit

Permalink
Per #1019, need to subtract 1900 from the year and 1 from the month t…
Browse files Browse the repository at this point in the history
…o make this work. Seems like we should ADD these numbers where needed rather than subtracting them everywhere else!
  • Loading branch information
JohnHalleyGotway committed Jan 13, 2025
1 parent 8f5bedc commit add3aef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions src/tools/other/ascii2nc/file_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,17 +346,6 @@ bool FileHandler::_writeObservations()
if(!obs_units.all_empty()) units_sa = obs_units;
if(!obs_descs.all_empty()) descs_sa = obs_descs;

// JHG
cout << "JHG obs_names...";
obs_names.dump(cout);
cout << "\n";
cout << "JHG units_sa...";
units_sa.dump(cout);
cout << "\n";
cout << "JHG descs_sa...";
descs_sa.dump(cout);
cout << "\n";

nc_point_obs.write_to_netcdf(obs_names, units_sa, descs_sa);

return true;
Expand Down
4 changes: 2 additions & 2 deletions src/tools/other/ascii2nc/uscrn_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ time_t UscrnHandler::_getValidTime(const DataLine &dl) const {
}

// Parse time components
time_struct.tm_year = stoi(date_str.substr(0, 4));
time_struct.tm_mon = stoi(date_str.substr(4, 2));
time_struct.tm_year = stoi(date_str.substr(0, 4)) - 1900;
time_struct.tm_mon = stoi(date_str.substr(4, 2)) - 1;
time_struct.tm_mday = stoi(date_str.substr(6, 2));
time_struct.tm_hour = stoi(time_str.substr(0, 2));
time_struct.tm_min = stoi(time_str.substr(2, 2));
Expand Down

0 comments on commit add3aef

Please sign in to comment.