Simon Ford
/
time_example2
main.cpp
- Committer:
- simon
- Date:
- 2009-10-28
- Revision:
- 0:db4f5f114f42
File content as of revision 0:db4f5f114f42:
#include "mbed.h" int main() { while(1) { time_t seconds = time(NULL); printf("Time as seconds since January 1, 1970 = %d\n", seconds); printf("Time as a basic string = %s", ctime(&seconds)); char buffer[32]; strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds)); printf("Time as a custom formatted string = %s", buffer); wait(1); } }