Commit f8ab02c4 authored by Cédric Traizet's avatar Cédric Traizet

ENH: add getters for the date components in otb::Metadata::Time

parent c9d53c5b
......@@ -272,6 +272,17 @@ struct OTBMetadata_EXPORT Time : tm
return !(lhs < rhs);
}
/** @name Getters
* Getters on the date components
*/
///@{
int GetDay() const;
int GetMonth() const;
int GetYear() const;
int GetHour() const;
int GetMinute() const;
int GetSecond() const;
///@}
};
......
......@@ -196,6 +196,37 @@ std::istream& operator>>(std::istream& is, Time& val)
#undef _OTB_ISTREAM_EXPECT
int Time::GetDay() const
{
return tm_mday;
}
int Time::GetMonth() const
{
return tm_mon + 1;
}
int Time::GetYear() const
{
return tm_year + 1900;
}
int Time::GetHour() const
{
return tm_hour;
}
int Time::GetMinute() const
{
return tm_min;
}
int Time::GetSecond() const
{
return tm_sec + frac_sec;
}
std::string LUTAxis::ToJSON(bool multiline) const
{
std::ostringstream oss;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment