adjusted timestamp function to always return value in seconds

This commit is contained in:
kamilprzyb
2020-09-23 11:05:18 +02:00
parent 09f1f67778
commit 016c48645e
4 changed files with 6 additions and 5 deletions

View File

@@ -150,10 +150,11 @@ time_t getTime() {
return (time_t)value.count();
}
//returns system time in seconds
time_t getTimestamp() {
using namespace std::chrono;
milliseconds value = duration_cast<milliseconds>((time_point_cast<milliseconds>(system_clock::now())).time_since_epoch());
seconds value = duration_cast<seconds>((time_point_cast<seconds>(system_clock::now())).time_since_epoch());
return (time_t)value.count();
}