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 6:605138b5eef6, committed 2015-11-25
- Comitter:
- AkinoriHashimoto
- Date:
- Wed Nov 25 09:56:26 2015 +0000
- Parent:
- 5:82e566457502
- Commit message:
- ADJ TimeZone
Changed in this revision
| RealTimeClock.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/RealTimeClock.cpp Tue Nov 24 07:09:30 2015 +0000
+++ b/RealTimeClock.cpp Wed Nov 25 09:56:26 2015 +0000
@@ -8,7 +8,6 @@
{
setTimeZone(hour);
}
-
void RealTimeClock::setSecondsRealTime()
{
secRT = time(NULL);
@@ -71,27 +70,24 @@
void RealTimeClock::setTimeZone(TimeZone tz)
{
float hour= 0;
- if(UTC || GMT)
+ if(tz==UTC || tz==GMT)
hour= 0;
- if(JST)
+ if(tz == JST)
hour= +9;
- if(EST)
+ if(tz == EST)
hour= -5;
- if(CST)
+ if(tz == CST)
hour= -6;
- if(MST)
+ if(tz == MST)
hour= -7;
- if(PST)
+ if(tz == PST)
hour= -8;
-
this->setTimeZone(hour);
-
return;
}
void RealTimeClock::setTimeZone(float hour)
{
- this->offsetTimeZone= (int)(hour* 3600);
-
+ this->offsetTimeZone= (int)(hour* 3600+ 0.5);
return;
}