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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:18:32+00:00 2026-05-15T15:18:32+00:00

$day = date(‘l’, strtotime(’07/25/2010′)); echo $day ; echo date(m/d/Y, strtotime(first $day)); This prints out

  • 0
$day = date('l', strtotime('07/25/2010'));
echo "$day ";
echo date("m/d/Y", strtotime("first $day"));

This prints out Sunday 07/11/2010

$day = date('l', strtotime('07/25/2010'));
echo "$day ";
echo date("m/d/Y", strtotime("last $day"));

This prints out Sunday 07/04/2010

What’s going on here? Shouldn’t it be 07/04/2010 and 07/25/2010 respectively?

  • 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-15T15:18:32+00:00Added an answer on May 15, 2026 at 3:18 pm

    I think the answers are correct, because they are relative to the given date (which when not given defaults to today).

    Based on the PHP docs:

    The function expects to be given a
    string containing a US English date
    format and will try to parse that
    format into a Unix timestamp (the
    number of seconds since January 1 1970
    00:00:00 UTC), relative to the
    timestamp given in now, or the current
    time if now is not supplied.

    So FIRST SUNDAY is in fact the 11th, and LAST SUNDAY was in fact the 4th. Based on the wording of your question, it appears you are looking for the 1st Sunday of the month, and the last Sunday of the month. This function returns the first Sunday AFTER today, and the LAST Sunday before today.

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

Sidebar

Related Questions

How to get first sunday or nth sunday or monday (any day) date in
In Unix, I want to find the date (day of month) of the last
the output should process the first date as day and second as night. I've
this is my basic date-time structure: primary key(datetime) key auot_id date_time user_id 1 2010-10-01
So I was trying to work this out but it seems that the last
I have a table like this: date day weather 2000-01-01 Monday Sunny 2000-01-02 Tuesday
I have jquery calendar code like this <script> $(document).ready(function() { $('#calTwo').jCal({ day: new Date(
I can extract the month and day by using Day(Date()) , Month(Date()) . I
ID Date Day Status 001 23/02/2009 Monday Appear 001 24/02/2009 Tuesday Appear 001 25/02/2009
With reference to Problem with date day/month reversing on save I have further noted

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.