Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Timestamp reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Foulds committed Aug 18, 2023
1 parent 5cc1fd3 commit 5e209ba
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,11 @@ std::string Metadata::Mac() const

std::string Metadata::ReportTimestamp() const
{
auto t = std::time(nullptr);
auto tm = *std::localtime(&t);
std::time_t t = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
std::stringstream timeStream;
timeStream << std::put_time( std::localtime( &t ), "%FT%T%z" );

std::stringstream buffer;
buffer << std::put_time(&tm, "%Y-%m-%d %H:%M:%S");

return buffer.str();
return timeStream.str();
}

long Metadata::Duration() const
Expand Down

0 comments on commit 5e209ba

Please sign in to comment.