File System Component  Version 6.6
MDK-Professional Middleware for Devices with Flash File System
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
File Time Support Routines

File time support routines return the current date and time. More...

Functions

fsStatus fs_get_time (fsTime *time)
 Callback function used to provide the current date and time to the File System.
 

Description

They can be used to set the file timestamp. The file timestamp information is available in devices with the FAT file system, it is not supported for non-FAT volumes.

Function Documentation

fsStatus fs_get_time ( fsTime time)
Parameters
[out]timePointer to the fsTime structure.
Returns
execution status fsStatus
  • fsOK = Operation successful.
  • fsError = Failed to get the current time
Note
This function supports FAT drives only.

The function fs_get_time function returns a time value.

The argument time is a pointer to the values of the hour, minute, second, day, month, and year in a fsTime structure.

Code Example

..
// Real time should be read from the RTC
..
// Fill the FS_TIME structure with the time information
time->hr = 12; // Hours: 0 - 23
time->min = 0; // Minutes: 0 - 59
time->sec = 0; // Seconds: 0 - 59
time->day = 1; // Day: 1 - 31
time->mon = 1; // Month: 1 - 12
time->year = 2013; // Year: 1980 - 2107
return (fsOK);
}