Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DateTime / DateTime.cpp
diff options
context:
space:
mode:
1 files changed, 11 insertions, 0 deletions
-rw-r--r--src/DateTime/DateTime.cpp11
diff --git a/src/DateTime/DateTime.cpp b/src/DateTime/DateTime.cpp
index 56ddba1..96e20b3 100644
--- a/src/DateTime/DateTime.cpp
+++ b/src/DateTime/DateTime.cpp
@@ -79,3 +79,14 @@ bool DateTime::set_year(unsigned short newYear) {
year = newYear;
return true;
}
+
+/* Outside of class */
+
+std::istream& operator>>(std::istream& istr, DateTime& dt) {
+ unsigned short h, m, d, M, y;
+ istr >> h >> m >> d >> M >> y;
+ dt = DateTime(h, m, d, M, y);
+ return istr;
+}
+
+std::ostream& operator<<(std::ostream& ostr, const DateTime& dt);