#include <iostream>
#include <chrono>
#include <iomanip> // put_time
int main() {
// Get the current time as a time_point
auto now = std::chrono::system_clock::now();
// Convert to time_t to get calendar time
std::time_t now_time_t = std::chrono::system_clock::to_time_t(now);
// Convert to tm structure for UTC
std::tm utc_tm = *std::gmtime(&now_time_t);
// Adjust for London time
std::tm london_tm = utc_tm;
std::cout << "Current date and time in London: "
<< std::put_time(&london_tm, "%Y-%m-%d %H:%M:%S") << std::endl;
}
/*
run:
Current date and time in London: 2025-02-27 06:57:27
*/