Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 4:d1c394cd7b63, committed 2015-11-19
- Comitter:
- AkinoriHashimoto
- Date:
- Thu Nov 19 07:56:35 2015 +0000
- Parent:
- 3:3f5628269a53
- Child:
- 5:82e566457502
- Commit message:
- Include JPN (+09:00) in setTime.
Changed in this revision
--- a/RealTimeClock.cpp Fri Oct 16 07:00:44 2015 +0000
+++ b/RealTimeClock.cpp Thu Nov 19 07:56:35 2015 +0000
@@ -37,15 +37,16 @@
}
-bool RealTimeClock::setRealTime(string str)
+bool RealTimeClock::setRealTime(string str, bool JPN)
{
// now is in range of appropriate time.
- return setRealTime(A2I(str, 10));
+ return setRealTime(A2I(str, 10), JPN);
}
-bool RealTimeClock::setRealTime(long now)
+bool RealTimeClock::setRealTime(long now, bool JPN)
{
- now += 3600* 9; // + JST 9hour.
+ if(JPN)
+ now += 3600* 9; // + JST 9hour.
// 1,427,597,183(ISO 8601形式: 2015/03/29 02:46:23Z)
// 2,147,483,647秒を経過した (2038/01/19 03:14:07)
if(!(1427597183<now && now<2147483600))
--- a/RealTimeClock.h Fri Oct 16 07:00:44 2015 +0000
+++ b/RealTimeClock.h Thu Nov 19 07:56:35 2015 +0000
@@ -10,12 +10,6 @@
*/
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();
@@ -30,15 +24,21 @@
string getHMS6();
/**
- * @param seconds from 1970/01/01.
+ * @param 'seconds' from 1970/01/01.
* @rtnval success(true), failure(false)
*/
- bool setRealTime(string str);
+ bool setRealTime(string str, bool JPN= true);
/**
* @param seconds from 1970/01/01.
* @rtnval void
*/
- bool setRealTime(long now);
+ bool setRealTime(long now, bool JPN= true);
+
+private:
+ time_t secRT; // secondsRealTime. JST; 9hour
+ char buf[14]; // using for strftime()
+ string bufTmp; // return value
+ void setSecondsRealTime(); // set secRt;
};
\ No newline at end of file
--- a/StrLib.lib Fri Oct 16 07:00:44 2015 +0000 +++ b/StrLib.lib Thu Nov 19 07:56:35 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/AkinoriHashimoto/code/StrLib/#9afdff23f890 +http://developer.mbed.org/users/AkinoriHashimoto/code/StrLib/#7bc89a64bfbd