summaryrefslogtreecommitdiff
path: root/7p40.cpp
diff options
context:
space:
mode:
Diffstat (limited to '7p40.cpp')
-rw-r--r--7p40.cpp40
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;
+}