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

Provides system clock functions. More...

Functions

DateTime SystemClockClass::now (TimeZone timeType=eTZ_Local)
 Get the current date and time. More...
 
void SystemClockClass::setTime (time_t time, TimeZone timeType=eTZ_Local)
 Set the system clock's time. More...
 
String SystemClockClass::getSystemTimeString (TimeZone timeType=eTZ_Local)
 Get current time as a string. More...
 
bool SystemClockClass::setTimeZone (double localTimezoneOffset)
 Sets the local time zone offset. More...
 

Variables

SystemClockClass SystemClock
 Global instance of system clock object. More...
 

Detailed Description

Provides system clock functions.

Function Documentation

String SystemClockClass::getSystemTimeString ( TimeZone  timeType = eTZ_Local)

Get current time as a string.

Parameters
timeTypeTime zone to use
Return values
StringCurrent time in format: dd.mm.yy hh:mm:ss
Todo:
Allow time format to be defined
DateTime SystemClockClass::now ( TimeZone  timeType = eTZ_Local)

Get the current date and time.

Parameters
timeTypeTime zone to use
Return values
DateTimeCurrent date and time
void SystemClockClass::setTime ( time_t  time,
TimeZone  timeType = eTZ_Local 
)

Set the system clock's time.

Parameters
timeTime to set clock to
timeTypeTime zone to use
bool SystemClockClass::setTimeZone ( double  localTimezoneOffset)

Sets the local time zone offset.

Parameters
localTimezoneOffsetOffset from UTC (GMT) of local time zone in hours
Return values
boolTrue on success
Todo:
Why does this need to be set to 2 for UK during winter?

Variable Documentation

SystemClockClass SystemClock

Global instance of system clock object.

Note
Use SystemClock.function to access system clock functions
Example:
1 SystemClock.setTimeZone(-2);