Questions tagged [filemtime]

File Modification Time, also known as mtime. On a UNIX filesystem, concepts similar to mtime include atime (access time) and ctime (metadata change time).

143 questions
-1
votes
1 answer

Getting file timestamp with php goes wrong

I have the following code: public static function getLogFiles() { $dir = '../tmp/logs'; $files = scandir($dir); foreach ($files as $filename){ echo "$filename wurde zuletzt modifiziert:: " . date ("F d Y H:i:s.",…
Binary
  • 133
  • 2
  • 8
-2
votes
1 answer

The filemtime () isn't working for my script, but is working fine for the script where I copied the example code

I have a .txt file located under some folder of my data files. Now I have created a long polling system (actually copied the code ) which is run by ajax. Now the problem is that my php script is unable to fetch file modification time of the text…
amankrokx
  • 52
  • 5
-2
votes
1 answer

Time stamp of File in PHP - filemtime()

I am trying to get the time stamp using filemtime() of each file and display it on the web page in PHP, I tried much as possible but only getting 1 Jan 1970 as time stamp in return. Which basically means the timestamp function is not getting the…
Rahilkhan Pathan
  • 504
  • 6
  • 13
-2
votes
2 answers

How to Delete few older images using php?

I want to delete images from a specific category that are older than a certain age (say, 2 months). These images are located in directory somewhere, if I use the following code:
Hafiz Usman aftab
  • 300
  • 2
  • 5
  • 15
-2
votes
1 answer

Php delete all jpg but 20 newest

So.. I've been looking around, but not really found what I need, so here goes: I got a webcam set to upload jpg's to a folder, but to avoid my server getting overflown with files, I want to clean out all jpg's but 20 newest when I load the page that…
Christian
  • 3
  • 2
-2
votes
2 answers

Linux ''find'' command: File aging for special extention. Regex and mtime doesn't work together

My .sh file is like below: #!/bin/sh FOLDER = '/home/Desktop/myUserName/My_monitored_folder' ASD= 'cd $FOLDER' REGEX = '.*xxx.yyy*.*' $ASD CMD = 'find -regextype posix-extended -regex $REGEX -mtime +0h10m0s' $CMD | xargs ls -Blatr** My find…
akemko
  • 55
  • 10
-2
votes
2 answers

Listing files timestamped within last two hours in Python

I have a directory full of files that are generated every 5 minutes. When I do an ls -l at a cmd prompt I can see the files and their last modified time. I need to programatically get a list of files that are timestamped within the last N minutes.…
Jonesome Reinstate Monica
  • 6,618
  • 11
  • 65
  • 112
-6
votes
1 answer

php static countdown with filemtime

A file updates every 60 minutes. I would like to have a countdown for the next update from comparing filemtime with time. I'm getting a brain fart dealing with time
hitmanex
  • 1
  • 1
  • 2
1 2 3
9
10