mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 02:34:48 +08:00
gmtime_r
This commit is contained in:
parent
48e1a7648e
commit
361cd83fce
1 changed files with 9 additions and 2 deletions
|
@ -8,6 +8,13 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Main command parser entry point
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
/* Ensure gmtime_r is available even with -std=c99; must be included before
|
||||
*/
|
||||
#if !defined(_WIN32)
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#endif
|
||||
#include "cmdmain.h"
|
||||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
@ -16,9 +23,9 @@ static int CmdRem(const char *Cmd) {
|
|||
char buf[22];
|
||||
|
||||
memset(buf, 0x00, sizeof(buf));
|
||||
struct tm *curTime;
|
||||
struct tm *curTime = NULL;
|
||||
time_t now = time(0);
|
||||
curTime = gmtime(&now);
|
||||
gmtime_r(&now, curTime);
|
||||
strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%SZ", curTime); // ISO8601
|
||||
PrintAndLogEx(NORMAL, "%s remark: %s", buf, Cmd);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue