diff options
author | 2021-05-02 21:10:57 +0200 | |
---|---|---|
committer | 2021-05-02 21:24:45 +0200 | |
commit | ba6e0b72a7908309ce8c428ddbe59bf1f5f1ac52 (patch) | |
tree | 29b40fe78b76ff5e1dd85bdfcfb1a23602931171 /src/lib/util/timeconv.cpp | |
parent | 0a8757673ff571dd6e47d9ee5b95c3745078b2db (diff) |
prodos: Start of read support
Diffstat (limited to 'src/lib/util/timeconv.cpp')
-rw-r--r-- | src/lib/util/timeconv.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/util/timeconv.cpp b/src/lib/util/timeconv.cpp index 20f4e29a03e..084e989b513 100644 --- a/src/lib/util/timeconv.cpp +++ b/src/lib/util/timeconv.cpp @@ -32,6 +32,23 @@ std::chrono::system_clock::duration system_clock_adjustment(calculate_system_clo IMPLEMENTATION ***************************************************************************/ +arbitrary_datetime arbitrary_datetime::now() +{ + time_t sec; + time(&sec); + auto t = *localtime(&sec); + + arbitrary_datetime dt; + dt.year = t.tm_year + 1900; + dt.month = t.tm_mon + 1; + dt.day_of_month = t.tm_mday; + dt.hour = t.tm_hour; + dt.minute = t.tm_min; + dt.second = t.tm_sec; + + return dt; +} + static std::chrono::system_clock::duration calculate_system_clock_adjustment() { constexpr auto days_in_year(365); |