Static Public Member Functions | List of all members
DateTime Struct Referencefinal

Date and time utilities simplified. More...

#include <DateTime.hpp>

Static Public Member Functions

template<typename Rep , typename Period >
static std::chrono::duration< Rep, Period > toDuration (const char *format, const std::string &s)
 Create a duration from the supplied string which is in the specified format. More...
 
template<typename AllocatorT , typename Clock , typename Dur >
static U8String< AllocatorT > toString (const char *format, const std::chrono::time_point< Clock, Dur > &tp)
 Format the time point as a string with the specified format. More...
 
template<typename Clock , typename Dur >
static std::string toString (const char *format, const std::chrono::time_point< Clock, Dur > &tp)
 Format the time point as a string with the specified format. More...
 
template<typename Clock , typename Dur >
static void toString (std::ostream &stream, const char *format, const std::chrono::time_point< Clock, Dur > &tp)
 Format the time point as a string with the specified format into the supplied output stream. More...
 
template<typename AllocatorT , typename Rep , typename Period >
static U8String< AllocatorT > toString (const char *format, const std::chrono::duration< Rep, Period > &d)
 Format the duration as a string with the specified format. More...
 
template<typename Rep , typename Period >
static std::string toString (const char *format, const std::chrono::duration< Rep, Period > &d)
 Format the duration as a string with the specified format. More...
 
template<typename Rep , typename Period >
static void toString (std::ostream &stream, const char *format, const std::chrono::duration< Rep, Period > &d)
 Format the duration as a string with the specified format into the supplied output stream. More...
 

Detailed Description

Date and time utilities simplified.

Member Function Documentation

◆ toDuration()

static std::chrono::duration<Rep, Period> toDuration ( const char *  format,
const std::string &  s 
)
inlinestatic

Create a duration from the supplied string which is in the specified format.

Refer to the formatting documentation at https://howardhinnant.github.io/date/date.html for details on the format placeholders.

Example format: "%Y-%m-%d %H:%M:%S"

◆ toString() [1/6]

static U8String<AllocatorT> toString ( const char *  format,
const std::chrono::time_point< Clock, Dur > &  tp 
)
inlinestatic

Format the time point as a string with the specified format.

Refer to the formatting documentation at https://howardhinnant.github.io/date/date.html for details on the format placeholders.

Example format: "%Y-%m-%d %H:%M:%S"

◆ toString() [2/6]

static std::string toString ( const char *  format,
const std::chrono::time_point< Clock, Dur > &  tp 
)
inlinestatic

Format the time point as a string with the specified format.

Refer to the formatting documentation at https://howardhinnant.github.io/date/date.html for details on the format placeholders.

Example format: "%Y-%m-%d %H:%M:%S"

◆ toString() [3/6]

static void toString ( std::ostream &  stream,
const char *  format,
const std::chrono::time_point< Clock, Dur > &  tp 
)
inlinestatic

Format the time point as a string with the specified format into the supplied output stream.

Refer to the formatting documentation at https://howardhinnant.github.io/date/date.html for details on the format placeholders.

Example format: "%Y-%m-%d %H:%M:%S"

◆ toString() [4/6]

static U8String<AllocatorT> toString ( const char *  format,
const std::chrono::duration< Rep, Period > &  d 
)
inlinestatic

Format the duration as a string with the specified format.

Refer to the formatting documentation at https://howardhinnant.github.io/date/date.html for details on the format placeholders.

Example format: "%Y-%m-%d %H:%M:%S"

◆ toString() [5/6]

static std::string toString ( const char *  format,
const std::chrono::duration< Rep, Period > &  d 
)
inlinestatic

Format the duration as a string with the specified format.

Refer to the formatting documentation at https://howardhinnant.github.io/date/date.html for details on the format placeholders.

Example format: "%Y-%m-%d %H:%M:%S"

◆ toString() [6/6]

static void toString ( std::ostream &  stream,
const char *  format,
const std::chrono::duration< Rep, Period > &  d 
)
inlinestatic

Format the duration as a string with the specified format into the supplied output stream.

Refer to the formatting documentation at https://howardhinnant.github.io/date/date.html for details on the format placeholders.

Example format: "%Y-%m-%d %H:%M:%S"


The documentation for this struct was generated from the following file: