-1

I am trying to determine the filetime of many different files as I'd like to get the version of these files. Is it a good opportunity to add (+) the filemtimes of the files? Doing this gives me a very high number (6807745113). Am I going to reach any overflow/cap with this or is it safe?

Thanks

lenny.myr
  • 903
  • 2
  • 11
  • 20
  • 32bit php only supports 32bit ints, so yes, you can VERY easily exceed the limit in as little as 2 files. remember, time stamps are SIGNED 32bit ints. – Marc B Feb 23 '13 at 17:48

1 Answers1

0

Isn't filemtime the seconds relative to 1970? You'd have to subtract out the current timestamp from each if you are just going for an total age relative to today (or some fixed point in time). As long as it's not a thousands of files which are very old, you should be fine. Otherwise, no, you probably should not add the raw epoch timestamps together.

Kevin Seifert
  • 3,494
  • 1
  • 18
  • 14
  • I need a static version for the files, because I am generating one css file out of many others. This file should only be created, if it should be (if the version isnt accurate anymore). Thus I cant use the subtract. – lenny.myr Feb 23 '13 at 18:07
  • Maybe in that case, I'd just concatenate all the timestamps with a delimiter and run the string through an md5 hash. Like md5("file:time;file2:time2") – Kevin Seifert Feb 23 '13 at 18:36