Skip to content

Commit

Permalink
Time_Calendar::date(double t) prints time as well (in hours)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckhroulev committed Aug 30, 2021
1 parent 1d3068a commit 00c29ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util/Time_Calendar.cc
Expand Up @@ -278,7 +278,10 @@ double Time_Calendar::year_fraction(double T) const {
std::string Time_Calendar::date(double T) const {
auto date = m_time_units.date(T, m_calendar_string);

return pism::printf("%04d-%02d-%02d", date.year, date.month, date.day);
double hour = date.hour + date.minute / 60.0 + date.second / 3600.0;

return pism::printf("%04d-%02d-%02d %04.1fh",
date.year, date.month, date.day, hour);
}

double Time_Calendar::calendar_year_start(double T) const {
Expand Down

0 comments on commit 00c29ae

Please sign in to comment.