Blender
V5.3
source
blender
blentranslation
BLT_date_string.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2026 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
13
14
#include <ctime>
15
#include <string>
16
17
#include "
BLI_string_ref.hh
"
18
19
namespace
blender::date_string
{
20
21
enum class
DateFormat
:
uint8_t
{
23
Default
= 0,
25
LE_Slash
= 1,
27
LE_Dot
= 2,
29
LE_Dash
= 3,
31
ME_Slash
= 4,
33
BE_Slash
= 5,
35
BE_Dot
= 6,
37
BE_Dash
= 7,
38
};
39
40
enum class
TimeFormat
:
uint8_t
{
42
H24
= 0,
44
H12
= 1,
45
};
46
47
std::tm
localtime_safe
(time_t
time
);
48
49
std::string
date
(
const
std::tm &date_time,
50
StringRef
locale_iso = {},
51
DateFormat
format =
DateFormat::Default
);
52
53
std::string
time
(
const
std::tm &date_time,
TimeFormat
format =
TimeFormat::H24
);
54
55
std::string
datetime
(
const
std::tm &date_time,
56
StringRef locale_iso = {},
57
DateFormat
date_format =
DateFormat::Default
,
58
TimeFormat
time_format =
TimeFormat::H24
,
59
const
std::tm *now =
nullptr
,
60
StringRef today = {},
61
StringRef yesterday = {});
62
63
}
// namespace blender::date_string
BLI_string_ref.hh
blender::StringRef
Definition
BLI_string_ref.hh:165
blender::date_string
Definition
BLT_date_string.hh:19
blender::date_string::DateFormat
DateFormat
Definition
BLT_date_string.hh:21
blender::date_string::DateFormat::LE_Dot
@ LE_Dot
Definition
BLT_date_string.hh:27
blender::date_string::DateFormat::ME_Slash
@ ME_Slash
Definition
BLT_date_string.hh:31
blender::date_string::DateFormat::LE_Dash
@ LE_Dash
Definition
BLT_date_string.hh:29
blender::date_string::DateFormat::Default
@ Default
Definition
BLT_date_string.hh:23
blender::date_string::DateFormat::BE_Dot
@ BE_Dot
Definition
BLT_date_string.hh:35
blender::date_string::DateFormat::LE_Slash
@ LE_Slash
Definition
BLT_date_string.hh:25
blender::date_string::DateFormat::BE_Slash
@ BE_Slash
Definition
BLT_date_string.hh:33
blender::date_string::DateFormat::BE_Dash
@ BE_Dash
Definition
BLT_date_string.hh:37
blender::date_string::TimeFormat
TimeFormat
Definition
BLT_date_string.hh:40
blender::date_string::TimeFormat::H12
@ H12
Definition
BLT_date_string.hh:44
blender::date_string::TimeFormat::H24
@ H24
Definition
BLT_date_string.hh:42
blender::date_string::time
std::string time(const std::tm &date_time, TimeFormat format=TimeFormat::H24)
Definition
date_string.cc:63
blender::date_string::datetime
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={})
Definition
date_string.cc:139
blender::date_string::localtime_safe
std::tm localtime_safe(time_t time)
Definition
date_string.cc:51
blender::date_string::date
std::string date(const std::tm &date_time, StringRef locale_iso={}, DateFormat format=DateFormat::Default)
Definition
date_string.cc:84
blender::uint8_t
unsigned char uint8_t
Definition
BKE_text.h:79
lexit::Default
@ Default
Definition
types.hh:129
Generated on
for Blender by
doxygen
1.18.0