Real Time Clock. get time-str, set time.
RealTimeClock.h
- Committer:
- AkinoriHashimoto
- Date:
- 2015-06-11
- Revision:
- 0:006ab0d7b90f
- Child:
- 2:32cfa1dac5a2
File content as of revision 0:006ab0d7b90f:
#pragma once #include "mbed.h" #include <string> #include "StrLib.h" /** Real Time Clock library * */ class RealTimeClock { private: time_t secRT; // secondsRealTime. JST; 9hour char buf[14]; // using for strftime() string bufTmp; // return value void setSecondsRealTime(); // set secRt; public: /** @rtnval YY/MM/DD */ string getYMD8(); /** @rtnval YYMMDD */ string getYMD6(); /** @rtnval HH:MM:SS */ string getHMS8(); /** @rtnval HHMMSS */ string getHMS6(); /** * @param seconds from 1970/01/01. * @rtnval success(true), failure(false) */ bool setRealTime(string str); /** * @param seconds from 1970/01/01. * @rtnval void */ void setRealTime(long now); };