summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-04-24 19:19:06 +0200
committerlouiz’ <louiz@louiz.org>2018-04-24 20:25:40 +0200
commit61de6b1dac4ef29627f3bdb9ce11b6c0d06f4a24 (patch)
treef1da873798506627587ef7cdce23062d556b454a /src/utils
parenta90f196a1ce779d502baf0aadff6e6917fec8a02 (diff)
downloadbiboumi-61de6b1dac4ef29627f3bdb9ce11b6c0d06f4a24.tar.gz
biboumi-61de6b1dac4ef29627f3bdb9ce11b6c0d06f4a24.tar.bz2
biboumi-61de6b1dac4ef29627f3bdb9ce11b6c0d06f4a24.tar.xz
biboumi-61de6b1dac4ef29627f3bdb9ce11b6c0d06f4a24.zip
Revert "Use a different Date data type"
This reverts commit 857c7d3972a03cbeebf730d99b924d3710dee6a0.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/datetime.hpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/utils/datetime.hpp b/src/utils/datetime.hpp
deleted file mode 100644
index 656b318..0000000
--- a/src/utils/datetime.hpp
+++ /dev/null
@@ -1,56 +0,0 @@
-#pragma once
-
-#include <chrono>
-#include <string>
-
-#include <logger/logger.hpp>
-
-class DateTime
-{
-public:
- enum class Engine {
- Postgresql,
- Sqlite3,
- } engine{Engine::Sqlite3};
-
- using time_point = std::chrono::system_clock::time_point;
-
- DateTime():
- s{},
- t{}
- { }
-
- DateTime(std::time_t t):
- t(std::chrono::seconds(t))
- {}
-
- DateTime(std::string s):
- s(std::move(s))
- {}
-
- DateTime& operator=(const std::string& s)
- {
- this->s = s;
- return *this;
- }
-
- DateTime& operator=(const time_point t)
- {
- this->t = t;
- return *this;
- }
-
- const std::string& to_string() const
- {
- return this->s;
- }
-
- time_point::duration epoch() const
- {
- return this->t.time_since_epoch();
- }
-
-private:
- std::string s;
- time_point t;
-};