From 492fc44e1667a2a5d7afd67bab4a14b75a12cb0a Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 1 May 2022 09:15:51 +0300 Subject: Autocommit at 01.05.2022 @ 09:15 --- src/DateTime/DateTime.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/DateTime/DateTime.cpp') 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); -- cgit v1.3.1-23-gd82d