Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 7 months ago.
Date on File System
Dear all, I own LPC1768 mbed. I am trying to use the LocalFileSystem but I cannot make it write the correct date, it always shows 01/01/2008 12:00. I supposed that date and time are added automatically to the file name (like when you save a file PC) but perhaps I am missing to set something up. I have not found a command to read from the LPC1768 the date and time of files stored in the LocalFileSystem from the PC (with correct date and time). Thank you in advance. Best regards
1 Answer
8 years, 7 months ago.
You need to set the time, the system can't give valid time stamps if it doesn't know the correct time.
Use
set_time(timeValue);
where timeValue is the time in seconds since January 1st 1970
There are lots of sites which will calculate the time for you for any date you want e.g. http:www.unixtimestamp.com/