initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace radiantwave::timezone {
|
||||
|
||||
struct TimeZoneInfo {
|
||||
std::string display_name;
|
||||
std::string iana_code;
|
||||
};
|
||||
|
||||
struct CountryTimeZones {
|
||||
std::string country_name;
|
||||
std::vector<TimeZoneInfo> zones;
|
||||
};
|
||||
|
||||
// Returns standard Linux / IANA timezones grouped by country
|
||||
const std::vector<CountryTimeZones>& getStandardTimeZones();
|
||||
|
||||
// Converts a UTC timestamp to the user's configured IANA timezone
|
||||
std::string formatUtcToTimezone(time_t utc_time, const std::string& iana_code, const std::string& format = "%Y-%m-%d %H:%M:%S %Z");
|
||||
|
||||
// Gets current UTC timestamp as ISO string
|
||||
std::string getUtcTimestampIso();
|
||||
|
||||
} // namespace radiantwave::timezone
|
||||
Reference in New Issue
Block a user