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

  • Home
  • SEARCH
  • 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 8487571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:17:01+00:00 2026-06-10T21:17:01+00:00

I am constructing a diary that has weekly views which I thought I had

  • 0

I am constructing a diary that has weekly views which I thought I had cracked because the dates seemed to appears as correct. It wasn’t until my MySQL queries kept returning what seemed like random results that I realized the the month is actually being seen as the day instead.

$week_number = date("W");
$year = date("Y");

for ($day=0; $day<=6; $day++) {
    $daily_date = date('d/m/Y', strtotime($year."W".$week_number.$day))."\n";
    $StartDate = date('d', strtotime($daily_date));
}

echo $starteDate;

$startDate returns the number of the month rather than the day and sure enough date('m', strtotime($daily_date)) returns the day rather than the month.

I can’t understand where I have made this silly mistake so any help would be appreciated.

  • 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-06-10T21:17:02+00:00Added an answer on June 10, 2026 at 9:17 pm

    This is because of the Americanisation of dates – strtotime will read the date as m/d/Y rather than d/m/Y.

    The ISO for dates is Y-m-d and for ease I would use this format when doing any kind of date manipulation.

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

Sidebar

Related Questions

I'm constructing a regex that is looking for dates. I would like to return
I am constructing a query that will naturally return a result that has values
I'm constructing a Form and it has several numericUpDown controls, several checkbox controls and
We are constructing an application that will be interacting with Exchange 2007 calendar functions.
I'm constructing an ecommerce application in Symfony, and I have a page which lists
I am constructing a webcomic site, but the chapter order has changed significantly. I
I'm constructing an area with selectable buttons that transition and appear every 10 frames.
I am constructing an application which will be able to output data to RSS
I'm constructing a program which uses mprotect() to restrict a block of memory from
I am currently constructing an OWL ontology, which - until very recently classified rapidly

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.