LibSWOC++ 1.5.14
Solid Wall of C++
Loading...
Searching...
No Matches
swoc::bwf::Date Struct Reference

#include <bwf_ex.h>

Collaboration diagram for swoc::bwf::Date:
Collaboration graph

Public Member Functions

 Date (time_t t, std::string_view fmt=DEFAULT_FORMAT)
 
 Date (std::string_view fmt=DEFAULT_FORMAT)
 Default construct using current time with optional format.
 

Public Attributes

time_t _epoch
 The time.
 
std::string_view _fmt
 Data format.
 

Static Public Attributes

static constexpr std::string_view DEFAULT_FORMAT {"%Y %b %d %H:%M:%S"_sv}
 Default format.
 

Detailed Description

Format wrapper for time stamps. If the time isn't provided, the current epoch time is used. If the format string isn't provided a format like "2017 Jun 29 14:11:29" is used.

Definition at line 45 of file bwf_ex.h.

Constructor & Destructor Documentation

◆ Date() [1/2]

swoc::bwf::Date::Date ( time_t t,
std::string_view fmt = DEFAULT_FORMAT )
inline

Constructor.

Parameters
tThe timestamp.
fmtTimestamp format.

Definition at line 56 of file bwf_ex.h.

◆ Date() [2/2]

swoc::bwf::Date::Date ( std::string_view fmt = DEFAULT_FORMAT)

Default construct using current time with optional format.

Definition at line 852 of file bw_format.cc.

Member Data Documentation

◆ _epoch

time_t swoc::bwf::Date::_epoch

The time.

Definition at line 48 of file bwf_ex.h.

◆ _fmt

std::string_view swoc::bwf::Date::_fmt

Data format.

Definition at line 49 of file bwf_ex.h.

◆ DEFAULT_FORMAT

std::string_view swoc::bwf::Date::DEFAULT_FORMAT {"%Y %b %d %H:%M:%S"_sv}
staticconstexpr

Default format.

Definition at line 47 of file bwf_ex.h.


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