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 6372249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:12:46+00:00 2026-05-25T01:12:46+00:00

Timestamp is in this format date(‘m-d-Y H:i:s A’) which will result 08-26-2011 16:00:25 PM

  • 0

Timestamp is in this format date('m-d-Y H:i:s A') which will result 08-26-2011 16:00:25 PM.

I need a regular expression to parse a file with time stamps starting with last week and last month, ignore previous time stamps. Basically something like this:

if(preg_match("/TimestampsWithinLastWeek+String/", $match))
{
   //Do something
}
  • 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-25T01:12:47+00:00Added an answer on May 25, 2026 at 1:12 am

    Regex is not the right tool for this, use strtotime() instead:

    if( strtotime( $dateString ) > strtotime( "Monday last week" ) ) {
        //Do something
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to parse this date-time format 2011-12-02T16:18:12.479-05:00 into an mm/dd/yy
I have a standard mysql timestamp in this format 2011-11-14 20:06:24 . This timestamp
I have a date in this format: 20101101120000 I need to convert it to
I have a TIMESTAMP in the database for pages, so in this format $d=2011-01-03
This is my Below function in which I am passing timestamp, I need only
I have a little snippet that formats a date for a timestamp like this:
In my database I have a time stamp column...which reflects a format like this:
In this code long timestamp=1332782463298; Date d=new Date(timestamp); date=d.toLocaleString(); date is always current date.
i have a string field (and i can't change this because the date format)
I wondering what is the best way to convert a timestamp of this format

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.