#pragma once

#include <chrono>
#include <format>
#include <string>

namespace tools
{
//--------------------------------------------------------------
/* Generates an ISO 8601 formatted UTC timestamp string with millisecond precision.
 * The format is "YYYY-MM-DDTHH:MM:SS.sssZ", where 'Z' indicates UTC time.
 * Example output: "2026-05-22T14:41:16.770Z". */
inline std::string make_iso8601_utc_timestamp()
{
  const auto now = std::chrono::floor<std::chrono::milliseconds>(
    std::chrono::system_clock::now());

  // Ex: 2026-05-22T14:41:16.770Z
  return std::format("{:%FT%TZ}", now);
}
//--------------------------------------------------------------
}     // namespace tools