Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::text::DateTimeParser Class Reference

Date parser. More...

#include <DateTimeParser.h>

Static Public Member Functions

static std::optional< DateTimeparse (const std::string &format, const std::string &datetime)
 

Static Private Member Functions

static int count (const char *string, int max)
 

Detailed Description

Date parser.

Member Function Documentation

◆ count()

int DateTimeParser::count ( const char * string,
int max )
staticprivate

References count().

Referenced by count().

◆ parse()

std::optional< DateTime > DateTimeParser::parse ( const std::string & format,
const std::string & datetime )
static

Attempt to restore the string to a data structure

Parameters
formatTime match format
* yyyy Full year
* MM   Full month
* dd   Full day of the month
* HH   24-hour format hour
* mm   Full minute
* ss   Full second
* fff  Full millisecond
* rrr  Full microsecond
* %    Escape character
* '*'  Word
* z    UTC offset
* 
datetimeTime string
Returns
Time data structure

References c, sese::DateTime::FORMAT, timegm, and XX.

Referenced by sese::db::impl::MariaResultSetImpl::getDateTime(), sese::db::impl::PostgresResultSetImpl::getDateTime(), sese::db::impl::SqliteResultSetImpl::getDateTime(), and sese::db::impl::SqliteStmtResultSetImpl::getDateTime().


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