Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6062613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:04:19+00:00 2026-05-23T09:04:19+00:00

I am new to PHP and am writing a PHP script that contains a

  • 0

I am new to PHP and am writing a PHP script that contains a module which reads the file timestamp out of a file and then compare with system time to see whether the file is older than 5 minutes or not and I am wondering how that can be achieved. I am currently using

$timeStamp = strftime('%c', filectime($this->localPath));
$timeStamp2 = filectime($this->localPath);

The two $timeStamp and $timeStamp2 are different, the 1st one is more human readable

$timeStamp Mon Jun 20 15:17:01 2011
$timeStamp2 1308608221 

What does $timeStamp2 mean?

And again, how to see if the file is more than 5 minutes old?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:04:20+00:00Added an answer on May 23, 2026 at 9:04 am

    That is Unix timestamp actually (seconds since 1st jan 1970 or EPOCH)

    You can use time() function to get current time in same Unix format.

    And then subtract both time values to check whether difference is > 300 (5 min) or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a little new at PHP, so my script writing is still progressing. I
I have a php script that writes a text file to the same directory
The setup: I have a standard .php file (index.php) that contains two includes, one
I am writing a PHP script that imports a csv and inserts into a
I'm writing a script that will grab several files and then copy them into
Has anyone ever modified the post-new.php file in their WordPress installation? I want to
We are in the startup build phase of a new PHP webapp that will
Im new to PHP and I can't figure out what the rules are for
I am writing a shell script (which I suck at) and I need some
I'm a new guy in PHP OOP concepts. One of the first things that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.