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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:10:35+00:00 2026-05-31T08:10:35+00:00

I am working with dates, in both PHP as well as MySQL. EVerytime I

  • 0

I am working with dates, in both PHP as well as MySQL. EVerytime I use to convert date in unix format. But this time I have taken field in DB as date. But issue is it is taking yyyy-mm-dd format. I want to store it in dd-mm-yyyy format. Is this possible if I set default setting of DB. or each time I have to explode the dd-mm-yyyy format in PHP and convert it in YYYY-MM-DD format. Its my first query.

Second query is I wish to fetch the records from today’s date. I mean dates after today’s date. Like today then tomorrow then so on…. Is it possible to use order by on date field.

  • 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-31T08:10:36+00:00Added an answer on May 31, 2026 at 8:10 am

    Just use:

    $date = date('d-m-Y', strtotime($dateFromDB));
    

    That will convert from MySQL DateTime to the format you have specified.

    It is possible to order by date fields, e.g.:

    SELECT *
    FROM table
    WHERE date > [yourDate]
    ORDER BY date [DESC | ASC]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on creating a private messaging system, (PHP/MySQL) in which users can
I have a standard mysql timestamp in this format 2011-11-14 20:06:24 . This timestamp
I am trying this but is not working... why? <html> <body> <script type=text/javascript> var
I've faced a little trouble while i'm working with PHP: $now = date('Y-m-d H:i:s',
I'm in wordpress, trying to format the date output. This is the code I'm
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
I am working on a Rails application that needs to handle dates and times
I just wrote a stored function to calculate the working days between two dates.
Does anybody have any advice on working in a Date Driven Development environment? Essentially,
I am working to add 1 month to date() and save it in my

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.