Date a photo

Good evening everyone !

So here I am explaining my pb:

I did a montage of a camera and an infrared sensor using an arduino uno which is mounted on a shield SD, all to ensure that when someone passes in front of the camera sensor takes a photo and save it on the card, until it’s all right, then I put in the editing a clock vma 301 that I’ve already set before, and then what I did I included the library of the clock in the main code (cameraz + sd + sensor) and then in this code I create an object to indicate the clock is there, and when a picture is taken, when I put the card sd in my pc and I look the date of taking the picture, it tells me January 1, 2000, while I have set the clock, I do not understand … I put the code as an attachment thank you for your help!

Horloge___capteur___photo.ino (7.35 KB)

someone ?

Please post your code using tags and write your problem as a list or read it back to yourself, it makes little sense

I look the date of taking the picture, it tells me January 1, 2000

Hint: that is the date corresponding to the standard linux time of zero seconds.

Agree, though, your post makes little sense. Please read “How to use this forum” for advice on posting your code properly, and making sensible posts.

A few minutes with search suggests that the basic SD library doesn't seem to have a way to specify file creation date, but SdFat library does. There are a bunch of other threads discussing this matter.

The post is unreadable, but the word "clock" is definitely in there so, of you have an RTC on board, the output can be used to make the filename, and you do not need the SDFat in order to do this. Maybe that is all you need and, if that is what you are actually trying to do, it seems that you have simply failed to set the clock properly.

His code talks to an RTC.

If all he wants to do is put the time in the file name, sure, that's easy with SD library, or any SD-related library.

But if he wants the file modified date (ie, what's shown when you tell your file manager to "sort by date") as far as I can tell, you need SdFat, not just SD library to do that.

DrAzzy:
"sort by date"....you need SdFat, not just SD library to do that.

No.
Format the date sensibly 20190413, sort by name, and you get sort by date. There may be a good reason to use SDFat, but I doubt it, and this is definitely not it.

IF the OP want's to have the image of the date show in the picture, then there are fields that can be added to the image data file that can allow that to be done. But that function will have to be done on a PC that can copy the image data file.

Paul