Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
Date and time functions

Modules

 Network Time Protocol client
 Provides NTP client.
 
 Real Time Clock
 Access to the real time clock.
 
 System clock functions
 Provides system clock functions.
 
 Time and Delay
 Provides time and delay functions.
 

Classes

class  DateTime
 Date and time class. More...
 

Macros

#define SECS_PER_MIN   (60UL)
 
#define SECS_PER_HOUR   (3600UL)
 
#define SECS_PER_DAY   (SECS_PER_HOUR * 24L)
 
#define DAYS_PER_WEEK   (7L)
 
#define SECS_PER_WEEK   (SECS_PER_DAY * DAYS_PER_WEEK)
 
#define SECS_PER_YEAR   (SECS_PER_WEEK * 52L)
 
#define SECS_YR_2000   (946681200UL)
 
#define numberOfSeconds(_time_)   (_time_ % SECS_PER_MIN)
 
#define numberOfMinutes(_time_)   ((_time_ / SECS_PER_MIN) % SECS_PER_MIN)
 
#define numberOfHours(_time_)   (( _time_% SECS_PER_DAY) / SECS_PER_HOUR)
 
#define dayOfWeek(_time_)   (( _time_ / SECS_PER_DAY + 4) % DAYS_PER_WEEK)
 
#define elapsedDays(_time_)   ( _time_ / SECS_PER_DAY)
 
#define elapsedSecsToday(_time_)   (_time_ % SECS_PER_DAY)
 
#define previousMidnight(_time_)   (( _time_ / SECS_PER_DAY) * SECS_PER_DAY)
 
#define nextMidnight(_time_)   ( previousMidnight(_time_) + SECS_PER_DAY )
 
#define elapsedSecsThisWeek(_time_)   (elapsedSecsToday(_time_) + (dayOfWeek(_time_) * SECS_PER_DAY) )
 

Enumerations

enum  dtDays_t {
  dtSunday,
  dtMonday,
  dtTuesday,
  dtWednesday,
  dtThursday,
  dtFriday,
  dtSaturday
}
 Days of week. More...
 

Detailed Description

Macro Definition Documentation

#define dayOfWeek (   _time_)    (( _time_ / SECS_PER_DAY + 4) % DAYS_PER_WEEK)

Get day of week from given Unix time

#define elapsedDays (   _time_)    ( _time_ / SECS_PER_DAY)

Get elapsed days since 1970-01-01 from given Unix time

#define elapsedSecsThisWeek (   _time_)    (elapsedSecsToday(_time_) + (dayOfWeek(_time_) * SECS_PER_DAY) )

Get quantity of seconds since midnight at start of previous Sunday from given Unix time

#define elapsedSecsToday (   _time_)    (_time_ % SECS_PER_DAY)

Get quantity of seconds since midnight from given Unix time

#define nextMidnight (   _time_)    ( previousMidnight(_time_) + SECS_PER_DAY )

Get Unix time of midnight at end of day from given just Unix time

#define numberOfHours (   _time_)    (( _time_% SECS_PER_DAY) / SECS_PER_HOUR)

Get just hours part of given Unix time

#define numberOfMinutes (   _time_)    ((_time_ / SECS_PER_MIN) % SECS_PER_MIN)

Get just minutes part of given Unix time

#define numberOfSeconds (   _time_)    (_time_ % SECS_PER_MIN)

Get just seconds part of given Unix time

#define previousMidnight (   _time_)    (( _time_ / SECS_PER_DAY) * SECS_PER_DAY)

Get Unix time of midnight at start of day from given Unix time

Enumeration Type Documentation

enum dtDays_t

Days of week.

Enumerator
dtSunday 

Sunday.

dtMonday 

Monday.

dtTuesday 

Tuesday.

dtWednesday 

Wednesday.

dtThursday 

Thursday.

dtFriday 

Friday.

dtSaturday 

Saturday.