Update create date on SD card file

Status
Not open for further replies.

Wicky21

Well-known member
When im recording sound files to SD card through Teensy it will give some default create date and time. But i need to update exact date and time when creating wave files. Also currently i have access to time stamps. Just need to update the date and time of the created wave files. Also later again i need to extract these created date and time.
Any suggestions ?

Thank you
Wicky
 
It depends on what SD library you are using.


For SDFat library, i do this, to write the current date time upon WAV file creation:

Code:
    static void dateTime(uint16_t *date, uint16_t *time)
    {
        // return date using FAT_DATE macro to format fields
        *date = FAT_DATE(year(), month(), day());
        // return time using FAT_TIME macro to format fields
        *time = FAT_TIME(hour(), minute(), second());
    }

in my setup():

Code:
SdFile::dateTimeCallback(dateTime);
 
Status
Not open for further replies.
Back
Top