4 years, 3 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

4 years, 3 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/

Dear Andy, before posting my question I've set the date and checked it. I can write the date as text in the file so I can timestamp data on the file, the problem is with the date of the file. Best regards Daniel

posted by Daniel Bonafede 30 Mar 2016