4.4.1
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
Functions
fcppt.time

Description

Time query and formatting utilities.

Functions

FCPPT_DETAIL_SYMBOL std::tm fcppt::time::gmtime (std::time_t time)
 A wrapper around std::gmtime.
 
FCPPT_DETAIL_SYMBOL std::tm fcppt::time::localtime (std::time_t time)
 A wrapper around std::localtime.
 
template<typename Ch , typename Traits >
void fcppt::time::output_tm (std::basic_ostream< Ch, Traits > &_stream, std::tm const &_tm)
 Outputs a std::tm to a stream.
 
FCPPT_DETAIL_SYMBOL std::time_t fcppt::time::std_time ()
 A wrapper around std::time.
 

Function Documentation

◆ gmtime()

FCPPT_DETAIL_SYMBOL std::tm fcppt::time::gmtime ( std::time_t  time)

A wrapper around std::gmtime.

Converts time to an std::tm using std::gmtime.

Exceptions
<code>std::runtime_error</code>on failure.

◆ localtime()

FCPPT_DETAIL_SYMBOL std::tm fcppt::time::localtime ( std::time_t  time)

A wrapper around std::localtime.

Converts time to an std::tm using std::localtime.

Exceptions
<code>std::runtime_error</code>on failure.

◆ output_tm()

template<typename Ch , typename Traits >
void fcppt::time::output_tm ( std::basic_ostream< Ch, Traits > &  _stream,
std::tm const &  _tm 
)

Outputs a std::tm to a stream.

Outputs tm to stream using the std::time_put locale facet, obtained from the locale of stream. Example:

#include <fcppt/string_conv_locale.hpp>
#include <fcppt/time/gmtime.hpp>
#include <fcppt/time/output_tm.hpp>
#include <fcppt/time/std_time.hpp>
#include <fcppt/config/external_begin.hpp>
#include <iostream>
#include <fcppt/config/external_end.hpp>
int main()
{
std::cout.imbue(fcppt::string_conv_locale());
std::cout << '\n';
}

◆ std_time()

FCPPT_DETAIL_SYMBOL std::time_t fcppt::time::std_time ( )

A wrapper around std::time.

A wrapper around std::time, returning the current time.

Exceptions
<code>std::runtime_error</code>on failure.