Home > Net >  Convert instgram file name (Number) to date
Convert instgram file name (Number) to date

Time:11-16

i Download 2 files from instgram

504273856298686966_186593000.mp4
1445150401635783037_186593000.jpg

This part (_186593000) is dedicated to the user ID from which I downloaded the two files. What I'm interested in is the part before (Underscore _) that specifies the date of the file

When I used (Bulk Rename Utility) program, it changed the name of the two files (based on the actual date of the two files, not the name) to the following:

504273856298686966_186593000.mp4 TO 2013-07-20_18-29-09.mp4
1445150401635783037_186593000.jpg TO  2017-02-07_22-22-54.jpg

Is there a way For the extraction the date based on the filename (504273856298686966 AND 1445150401635783037) by php code?

CodePudding user response:

The prefix does not seem to have a format that corresponds to a datetime.

My assumption is that the Bulk Rename Utility used the metadata of the picture to get the date.

You should have a look at the EXIF extension , in particular the exif_read_data function, which extracts lot of data including the date.

CodePudding user response:

This looks more like a result of hash function, than like a timestamp, so I think no, there is no way to extract time from it. However, if you will download images through your own script, you can add a timestamp to the filename.

  • Related