Blender V5.3
blender::date_string Namespace Reference

Classes

struct  LocalePatterns

Enumerations

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

Functions

std::tm localtime_safe (time_t time)
std::string date (const std::tm &date_time, StringRef locale_iso={}, DateFormat format=DateFormat::Default)
std::string time (const std::tm &date_time, TimeFormat format=TimeFormat::H24)
std::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={})
static const LocalePatterns & get_locale_patterns (const StringRef locale_iso)

Enumeration Type Documentation

◆ DateFormat

Enumerator
Default 

Convention based on output language.

LE_Slash 

dd/mm/yyyy.

LE_Dot 

dd.mm.yyyy.

LE_Dash 

dd-mm-yyyy.

ME_Slash 

mm/dd/yyyy.

BE_Slash 

yyyy/mm/dd.

BE_Dot 

yyyy.mm.dd.

BE_Dash 

yyyy-mm-dd.

Definition at line 21 of file BLT_date_string.hh.

◆ TimeFormat

Enumerator
H24 

23:59

H12 

11:59 PM

Definition at line 40 of file BLT_date_string.hh.

Function Documentation

◆ date()

◆ datetime()

◆ get_locale_patterns()

const LocalePatterns & blender::date_string::get_locale_patterns ( const StringRef locale_iso)
static

Definition at line 27 of file date_string.cc.

References get_locale_patterns().

Referenced by date(), and get_locale_patterns().

◆ localtime_safe()

◆ time()

std::string blender::date_string::time ( const std::tm & date_time,
TimeFormat format = TimeFormat::H24 )

Definition at line 63 of file date_string.cc.

References BLT_I18NCONTEXT_TIME, CTX_IFACE_, H12, H24, and time().

Referenced by datetime(), localtime_safe(), and time().