Sese Framework
2.3.0
A cross-platform framework
|
Date time formatter class. More...
#include <DateTimeFormatter.h>
Static Public Member Functions | |
static std::string | format (const DateTime &date_time, const std::string &pattern=TIME_DEFAULT_PATTERN) |
static std::string | format (const std::unique_ptr< DateTime > &date_time, const std::string &pattern=TIME_DEFAULT_PATTERN) |
static uint64_t | parseFromGreenwich (const std::string &text) |
static uint64_t | parseFromISO8601 (const std::string &text) |
Static Protected Member Functions | |
static int | mon2number (const std::string &text) |
Static Protected Attributes | |
static const std::map< std::string, uint8_t > | MON_MAP |
static const std::array< std::string, 12 > | MON_ARRAY |
static const std::map< std::string, uint8_t > | MONTH_MAP |
static const std::array< std::string, 12 > | MONTH_ARRAY |
static const std::array< std::string, 7 > | WK_DAY |
static const std::array< std::string, 7 > | WEEK_DAY |
Date time formatter class.
Time format specifiers d Day of the month (1-31) dd Day of the month (01-31) ddd Abbreviated day of the week (Mon) dddd Full name of the day of the week (Monday) m Minute (0-59) mm Minute (00-59) M Month (1-12) MM Month (01-12) MMM Abbreviated month (Jun) MMMM Full name of the month (June) y Year (0-99) yy Year (00-99) yyy Year (000-999) yyyy Year (0000-9999) z Offset from UTC h 12-hour format (0-11) hh 12-hour format (00-11) H 24-hour format (0-23) HH 24-hour format (00-23) t AM / PM - can be used with the 12-hour format s Second (0-59) ss Second (00-59) f Millisecond (0-999) ff Millisecond (000-999) fff Microsecond (0-999) ffff Microsecond (000-999) % Escape character
|
static |
References count(), sese::DateTime::getDayOfWeek(), sese::DateTime::getDays(), sese::DateTime::getHours(), sese::DateTime::getMicroseconds(), sese::DateTime::getMilliseconds(), sese::DateTime::getMinutes(), sese::DateTime::getMonths(), sese::DateTime::getSeconds(), sese::DateTime::getUTC(), sese::DateTime::getYears(), MON_ARRAY, MONTH_ARRAY, WEEK_DAY, and WK_DAY.
Referenced by sese::net::http::HPackUtil::buildCookieString(), sese::record::SimpleFormatter::dump(), sese::text::overload::Formatter< DateTime >::format(), getDateTimeString(), sese::internal::service::http::HttpServiceImpl::handleRequest(), sese::net::http::HttpUtil::sendSetCookie(), sese::db::impl::PostgresPreparedStatementImpl::setDateTime(), and sese::db::impl::SqlitePreparedStatementImpl::setDateTime().
|
static |
|
staticprotected |
|
static |
Convert Greenwich Mean Time to timestamp
text | Greenwich Mean Time text "Tue, 17 Oct 2023 15:41:22 GMT" "Thu, 31-Dec-37 23:55:55 GMT" |
References timegm.
|
static |
Convert ISO 8601 time to timestamp
text | ISO 8601 time text "2023-06-20" "2023-06-20 16:46:55" "2023-06-20T16:46:55Z" "2023-06-20 16:46:55 +8" "2023-06-20T16:46:55+00:00" |
References sese::text::AbstractStringBuffer::split(), and timegm.
|
staticprotected |
Referenced by format().
|
staticprotected |
|
staticprotected |
Referenced by format().
|
staticprotected |
|
staticprotected |
Referenced by format().
|
staticprotected |
Referenced by format().