Fix deprecated ftm::localtime
This commit is contained in:
@@ -311,11 +311,6 @@ namespace OpenVulkano::Image
|
||||
altitude = std::abs(level);
|
||||
}
|
||||
|
||||
void ExifBuilder::SetTime(std::time_t timestamp)
|
||||
{
|
||||
dateTaken = StringFromTime(timestamp);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> ExifBuilder::Build()
|
||||
{
|
||||
std::vector<uint8_t> result;
|
||||
@@ -487,15 +482,9 @@ namespace OpenVulkano::Image
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string ExifBuilder::StringFromTime(std::time_t time)
|
||||
{
|
||||
return fmt::format("{:%Y:%m:%d %H:%M:%S}", fmt::localtime(time));
|
||||
}
|
||||
|
||||
std::string ExifBuilder::GetCurrentTimestamp()
|
||||
{
|
||||
auto now = std::chrono::system_clock::now();
|
||||
std::time_t currentTime = std::chrono::system_clock::to_time_t(now);
|
||||
return StringFromTime(currentTime);
|
||||
return fmt::format("{:%Y:%m:%d %H:%M:%S}", now); // TODO convert to local time
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user