2.10.0
Freundlich's C++ toolkit
Classes | Functions
fcppt.time

Description

Time query and formatting utilities.

Classes

class  fcppt::time::exception
 The exception base class for time exceptions. More...
 

Functions

FCPPT_DETAIL_SYMBOL fcppt::string fcppt::time::ctime (std::time_t time)
 A wrapper around std::ctime More...
 
FCPPT_DETAIL_SYMBOL std::tm fcppt::time::gmtime (std::time_t time)
 A wrapper around std::gmtime More...
 
FCPPT_DETAIL_SYMBOL std::tm fcppt::time::localtime (std::time_t time)
 A wrapper around std::localtime More...
 
FCPPT_DETAIL_SYMBOL fcppt::io::ostreamfcppt::time::output_tm (fcppt::io::ostream &stream, std::tm const &tm)
 Outputs an std::tm to a stream. More...
 
FCPPT_DETAIL_SYMBOL std::time_t fcppt::time::std_time ()
 A wrapper around std::time More...
 

Function Documentation

◆ ctime()

FCPPT_DETAIL_SYMBOL fcppt::string fcppt::time::ctime ( std::time_t  time)

A wrapper around std::ctime

Converts time into a string using std::ctime.

Parameters
timeThe time to convert into a string
Exceptions
fcppt::time::exceptionif anything fails

◆ 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.

Parameters
timeThe time to convert

◆ 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.

Parameters
timeThe time to convert

◆ output_tm()

FCPPT_DETAIL_SYMBOL fcppt::io::ostream& fcppt::time::output_tm ( fcppt::io::ostream stream,
std::tm const &  tm 
)

Outputs an 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/text.hpp>
#include <fcppt/io/cout.hpp>
#include <fcppt/time/gmtime.hpp>
#include <fcppt/time/output_tm.hpp>
#include <fcppt/time/std_time.hpp>
int
main()
{
fcppt::io::cout().imbue(
);
)
)
<< FCPPT_TEXT('\n');
}
Parameters
streamThe stream to output to
tmThe time struct to output
Returns
stream

◆ 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
fcppt::time::exceptionif an error occurs