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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:26:18+00:00 2026-06-11T12:26:18+00:00

I created a system that stores a non-standard date into the database. For every

  • 0

I created a system that stores a non-standard date into the database. For every post a user creates, a date is stored with this format Month day, year, i.e. September 15, 2012. I don’t think MySQL has a way to organize this data so I have to do so manually.

I could not come up with a way of doing this.

Please help me out,
thanks.

  • 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-11T12:26:19+00:00Added an answer on June 11, 2026 at 12:26 pm

    Sorting what you have will be very difficult. Month is first, yet it’s an alpha and can’t be sorted that way. Day is second, and year is last.

    You’ll be much better off using MySQL’s DATETIME or TIMESTAMP field types. At the very least, you can store it a unix timestamp with INT(10) and sort numerically.

    I’ve been using the unix timestamp approach for years, but I’m slowly switching over to TIMESTAMP because you can do a lot more with MySQL’s native date formats. As an added bonus, you can actually look at and understand the dates in phpMyAdmin without having to constantly write FROM_UNIXTIME(field). You just have to tell MySQL what timezone you’re operating on when you make the connection (if using TIMESTAMP).

    You should be able to easily convert what you have using strtotime. It will return FALSE if it can’t figure it out. How smoothly this goes depends on if you did any sanitization of the dates. If not, you may be able to do some cleanup with preg_replace.

    After you’ve converted the data in the database, you can display it how you want with PHP’s date function or MySQL’s DATE_FORMAT.

    What ever you choose to do, avoid sorting it in PHP. Let your database do as much of the sorting and fetching as possible.

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

Sidebar

Related Questions

I have created a table in the database that has a System.Guid as it's
I've created a login system that uses cookies and stores a session ID in
I have created a newsletter system that allows me to specify which members should
I'm developing a documents system that, each time that a new one is created,
I've created a master page that uses 3 instances of System.Web.UI.WebControls.AdRotator each backed by
It is said that fork system call creates a clone of the calling process,
I'm writing a program in Python that stores information for every file on the
in my app in the first activity i have created a database which stores
I have a table that stores a pupil_id, a category and an effective date
I would like to create a caching system that will bypass some mechanisms in

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.