Blender V5.3
BLT_date_string.hh File Reference
#include <ctime>
#include <string>
#include "BLI_string_ref.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::date_string

Enumerations

enum class  blender::date_string::DateFormat : uint8_t {
  blender::date_string::Default = 0 , blender::date_string::LE_Slash = 1 , blender::date_string::LE_Dot = 2 , blender::date_string::LE_Dash = 3 ,
  blender::date_string::ME_Slash = 4 , blender::date_string::BE_Slash = 5 , blender::date_string::BE_Dot = 6 , blender::date_string::BE_Dash = 7
}
enum class  blender::date_string::TimeFormat : uint8_t { blender::date_string::H24 = 0 , blender::date_string::H12 = 1 }

Functions

std::tm blender::date_string::localtime_safe (time_t time)
std::string blender::date_string::date (const std::tm &date_time, StringRef locale_iso={}, DateFormat format=DateFormat::Default)
std::string blender::date_string::time (const std::tm &date_time, TimeFormat format=TimeFormat::H24)
std::string blender::date_string::datetime (const std::tm &date_time, StringRef locale_iso={}, DateFormat date_format=DateFormat::Default, TimeFormat time_format=TimeFormat::H24, const std::tm *now=nullptr, StringRef today={}, StringRef yesterday={})

Detailed Description

This allows converting std::tm datetime structures to localized date and time strings. The localization is based on the CLDR from the current locale.

Definition in file BLT_date_string.hh.