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.
main.cpp
00001 #include "mbed.h" 00002 00003 int main() { 00004 set_time(1256729737); // Set RTC time to Wed, 28 Oct 2009 11:35:37 00005 00006 while (true) { 00007 time_t seconds = time(NULL); 00008 00009 printf("Time as seconds since January 1, 1970 = %d\n", seconds); 00010 00011 printf("Time as a basic string = %s", ctime(&seconds)); 00012 00013 char buffer[32]; 00014 strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds)); 00015 printf("Time as a custom formatted string = %s", buffer); 00016 00017 wait(1); 00018 } 00019 }
Generated on Tue Jul 12 2022 12:38:29 by
1.7.2