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.
Dependencies: SX1276Lib AdaFruit_RGBLCD MCP23017 mbed
Fork of AdaFruit_RGBLCD by
time_helper.cpp
- Committer:
- vtraveller
- Date:
- 2014-08-10
- Revision:
- 11:96146db429de
- Parent:
- 10:3fcab08717fc
File content as of revision 11:96146db429de:
#include "mbed.h"
#include "time_helper.h"
void GetTime(tm & out_sTM)
{
time_t nTime = time(0);
tm * pTM = ::localtime(&nTime);
::memcpy(&out_sTM,pTM,sizeof(out_sTM));
}
void SetTime(const tm & in_sTM)
{
tm sTM = { 0 };
memcpy(&sTM,&in_sTM,sizeof(sTM));
time_t nTime = mktime(&sTM);
set_time(nTime);
}
