ESP DateTime  0.2.0
Date Time Functions and Classes for ESP8266 and ESP32
DateFormatter Struct Reference

DateTime Formatter constants and static format methods. More...

#include <DateTime.h>

Static Public Member Functions

static String format (const char *fmt, const time_t timeSecs, const int timeZone=0)
 utility method for formatting time using fmt. More...
 

Static Public Attributes

constexpr static const char * ISO8601 = "%FT%T%z"
 ISO8601 date time string format (2019-11-29T23:29:55+0800). More...
 
constexpr static const char * HTTP = "%a, %d %b %Y %H:%M:%S GMT"
 RFC1123 date time string format (Fri, 29 Nov 2019 15:29:55 GMT) More...
 
constexpr static const char * SIMPLE = "%F %T"
 Simple date time string format (2019-11-29 23:29:55). More...
 
constexpr static const char * COMPAT = "%Y%m%d_%H%M%S"
 Compat date time string format (20191129_232955). More...
 
constexpr static const char * DATE_ONLY = "%F"
 Date Only date time string format (2019-11-29). More...
 
constexpr static const char * TIME_ONLY = "%T"
 Time Only date time string format (23:29:55). More...
 

Detailed Description

DateTime Formatter constants and static format methods.

Details in http://www.cplusplus.com/reference/ctime/strftime/

Member Function Documentation

◆ format()

static String DateFormatter::format ( const char *  fmt,
const time_t  timeSecs,
const int  timeZone = 0 
)
inlinestatic

utility method for formatting time using fmt.

Parameters
fmtdate time format string
timeSecstimestamp value
timeZonetimezone offset (-11,13)
Returns
String string representation of timeSecs

Member Data Documentation

◆ COMPAT

constexpr static const char* DateFormatter::COMPAT = "%Y%m%d_%H%M%S"
staticconstexpr

Compat date time string format (20191129_232955).

◆ DATE_ONLY

constexpr static const char* DateFormatter::DATE_ONLY = "%F"
staticconstexpr

Date Only date time string format (2019-11-29).

◆ HTTP

constexpr static const char* DateFormatter::HTTP = "%a, %d %b %Y %H:%M:%S GMT"
staticconstexpr

RFC1123 date time string format (Fri, 29 Nov 2019 15:29:55 GMT)

◆ ISO8601

constexpr static const char* DateFormatter::ISO8601 = "%FT%T%z"
staticconstexpr

ISO8601 date time string format (2019-11-29T23:29:55+0800).

◆ SIMPLE

constexpr static const char* DateFormatter::SIMPLE = "%F %T"
staticconstexpr

Simple date time string format (2019-11-29 23:29:55).

◆ TIME_ONLY

constexpr static const char* DateFormatter::TIME_ONLY = "%T"
staticconstexpr

Time Only date time string format (23:29:55).


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