diff options
author | Oskar <[email protected]> | 2024-09-28 11:18:41 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-09-28 11:18:41 +0200 |
commit | c2d59bb8a75c6228a91393b9cf3aedcb4d455218 (patch) | |
tree | d80f749de607f0c7a384cbd4c7cc3c3232a0ccb9 /7p40.cpp | |
parent | 8d61cae024eeee08b8126ee5482f211ca677dfd7 (diff) |
more
Diffstat (limited to '7p40.cpp')
-rw-r--r-- | 7p40.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/7p40.cpp b/7p40.cpp new file mode 100644 index 0000000..2161f0e --- /dev/null +++ b/7p40.cpp @@ -0,0 +1,40 @@ +#include <iostream> + +/* + * + * 7.40 + * + * + */ + +class Date { +public: + Date() { + epochtime = 11111111; // Just an example. This should "get" the current time. + } + Date(time_t i): epochtime(i) {} + std::ostream& printepoch(std::ostream& pecout) { + pecout << epochtime; + return pecout; + } + time_t getepoch() { return epochtime; } + std::string& getformatted() { + formatted = "TEST"; // Just an example, we format the time here. + return formatted; + } + +private: + time_t epochtime; + std::string formatted; +}; + +int main () { + + Date d1; + Date d2(342342423); + d1.printepoch(std::cout) << std::endl; + d2.printepoch(std::cout) << std::endl; + std::cout << d1.getepoch() << std::endl; + std::cout << d1.getformatted() << std::endl; + return 0; +} |