Fix windows build

This commit is contained in:
Georg Hagen
2025-06-24 00:01:02 +02:00
parent cab7c15607
commit bbac3f3f47

View File

@@ -1,3 +1,8 @@
/*
* Copyright (c) 2025. MadVoxel AG
* All rights reserved.
*/
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -97,13 +102,16 @@ namespace OpenVulkano::Image
[[maybe_unused]] XmpBuilder& XmpBuilder::SetCreateDateNow()
{
std::time_t currentTime = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
return SetCreateDate(currentTime);
return SetCreateDate(fmt::format("{:%FT%T%Ez}", std::chrono::system_clock::now()));
}
[[maybe_unused]] XmpBuilder& XmpBuilder::SetCreateDate(const std::time_t time)
{
#ifdef WIN32
return SetCreateDate(fmt::format("{:%FT%T%Ez}", std::chrono::system_clock::from_time_t(time)));
#else
return SetCreateDate(fmt::format("{:%FT%T%Ez}", fmt::localtime(time)));
#endif
}
[[maybe_unused]] XmpBuilder& XmpBuilder::SetCreateDate(const std::string& createDate)