Skip to content
Snippets Groups Projects
Commit 3d692cba authored by Stéphane Poirier's avatar Stéphane Poirier
Browse files

[Time] use new duration methods in some operators

parent e8c61eaa
No related branches found
No related tags found
No related merge requests found
......@@ -1506,6 +1506,38 @@ uint8 Time::get_month_from_name(const std::string& month_name)
throw Exception("ERROR", oss.str(), "Time::get_month_from_name");
}
//----------------------------------------------------------------------------
// Time::add
//----------------------------------------------------------------------------
Time& Time::add(const class Duration& d)
{
return add_sec(d.as<Seconds>().get());
}
//----------------------------------------------------------------------------
// Time::sub
//----------------------------------------------------------------------------
Time& Time::sub(const class Duration& d)
{
return add_sec(-d.as<Seconds>().get());
}
//----------------------------------------------------------------------------
// Time::operator +=
//----------------------------------------------------------------------------
Time& Time::operator +=(const class Duration& d)
{
return add_sec(d.as<Seconds>().get());
}
//----------------------------------------------------------------------------
// Time::operator -=
//----------------------------------------------------------------------------
Time& Time::operator -=(const class Duration& d)
{
return add_sec(-d.as<Seconds>().get());
}
//===========================================================================
// CurrentTime
//===========================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment