userver
C++ Async Framework
Loading...
Searching...
No Matches
from_string_saturating.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/utils/datetime/from_string_saturating.hpp
4
/// @brief Saturating converters from strings to time points.
5
/// @ingroup userver_universal
6
7
#
include
<
chrono
>
8
#
include
<
string
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
utils
::
datetime
{
13
14
/// @brief Converts strings like "2012-12-12T00:00:00" to
15
/// std::chrono::system_clock::time_point in UTC timezone and saturates on
16
/// overflow
17
/// Example:
18
/// @snippet utils/datetime/from_string_saturating_test.cpp FromStringSaturation
19
std
::
chrono
::
system_clock
::
time_point
FromRfc3339StringSaturating
(
const
std
::
string
&
timestring
);
20
21
/// @brief Converts strings of the specified format starting with "%Y" to
22
/// std::chrono::system_clock::time_point in UTC timezone and saturates on
23
/// overflow.
24
std
::
chrono
::
system_clock
::
time_point
FromStringSaturating
(
const
std
::
string
&
timestring
,
const
std
::
string
&
format
);
25
26
}
// namespace utils::datetime
27
28
USERVER_NAMESPACE_END
userver
utils
datetime
from_string_saturating.hpp
Generated on Tue Nov 19 2024 11:25:23 for userver by
Doxygen
1.10.0