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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:22:30+00:00 2026-06-17T13:22:30+00:00

I am pulling a date value from a MySQL DB formatted as 01/20/13 I

  • 0

I am pulling a date value from a MySQL DB formatted as 01/20/13 I am calling the PHP date function on this value returned to get what day of the week it is, so 01/20/13 is today’s date which is Sunday but it keeps returning the value Wednesday. I have included the code below I am new to programming so this is probably a stupid error I am overlooking.

<?php

        require '../TimeCard/DB.php';

    try{
    $stmt = $conn->prepare('SELECT `date` FROM `timeRecords` WHERE `employeeID`= 1 ');
    $stmt->execute();
    } catch(PDOException $e){
        echo'ERROR: ' . $e->getMessage();
    }

    while($row = $stmt->fetch())
  {
    echo date("l", $row['date']) . "<br>";
    echo $row['date'] . "<br>";
  }

        ?>
  • 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-17T13:22:31+00:00Added an answer on June 17, 2026 at 1:22 pm

    Mysql does not store dates as m/d/y it stores them as Y-m-d you’re mysql database will turn “01/20/13” into 0000-00-00.

    However, if you are not using the date type, and storing as a string use

    strtotime($row['date'])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im pulling a date from a database which is formatted like dd-mm-YYYY. What I
I have a date value (e.g. 2011-04-11 07:45:00.000) which I am pulling from my
I am pulling a date value from my database: Dim qfresho = From p
I am pulling out a date value in the format 2012-12-28 from a database
I am pulling data from Twitter's API and the return date is UTC in
I've been pulling my hair out with this function. It's a function within a
I'm pulling date values out of mysql and displaying them in locally used format.
We are currently porting some php scripts that are pulling datetimes from the facebook
Okay, I'm trying to get the String value of a DATE column in Oracle
I am pulling some data from a mysql table via the following: $result =

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.