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: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/CommandParser/cmd.cpp
- Revision:
- 131:a290a3934132
- Parent:
- 124:48119db89152
- Child:
- 132:45821e189dd0
--- a/src/CommandParser/cmd.cpp Mon Sep 26 12:35:12 2016 +0000 +++ b/src/CommandParser/cmd.cpp Mon Sep 26 17:36:30 2016 +0000 @@ -925,14 +925,27 @@ { UNUSED(argc); UNUSED(argv); - + + time_t rawtime; + time(&rawtime); + int iyr=0, imo=0, idy=0, ihr=0, imn=0, isc=0; rtc_get_time(&iyr, &imo, &idy, &ihr, &imn, &isc); - printf("%04d-%02d-%02d %02d:%02d:%02d\r\n", iyr, imo, idy, ihr, imn, isc); + printf("RTC time: %04d-%02d-%02d %02d:%02d:%02d\r\n", iyr, imo, idy, ihr, imn, isc); + + struct tm *time_info; + time_info = localtime(&rawtime); + printf("Local time: %04d-%02d-%02d %02d:%02d:%02d\r\n", + time_info->tm_year + 1900, + time_info->tm_mon + 1, // 0 = Jan, 11 = Dec + time_info->tm_mday, + time_info->tm_hour, + time_info->tm_min, + time_info->tm_sec); } /***************************************************************************** - * Function: cmd_time + * Function: cmd_outputs * Description: display outputs ****************************************************************************/ void cmd_outputs(int argc, char **argv)