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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:36:18+00:00 2026-06-02T05:36:18+00:00

When I make projects on my website, I’ve saved the time and date that

  • 0

When I make projects on my website, I’ve saved the time and date that I made them on in MySQL as ‘2012-02-27 12:32:36’ format.

How can I get this to display as:

“February 27, 2012 12:32 p.m.”?

I’ve looked at other date formatting on PHP and read on the PHP website, but all of the functions they provide don’t seem to be for grabbing a date in the format that I’ve saved it in.

  • 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-02T05:36:19+00:00Added an answer on June 2, 2026 at 5:36 am

    First, convert the MySQL DateTime string you have into a DateTime object by using DateTime::createFromFormat()

    $mysqlDateTime = '2012-02-27 12:32:36';
    $date = DateTime::createFromFormat('Y-m-d H:i:s', $mysqlDateTime);
    

    Then, simply call DateTime->format() with the desired format string:

    $formattedDate = $date->format('F j, Y g:i a');
    

    You can also use the MySQL UNIX_TIMESTAMP() date function (to extract a unix timestamp compatible with date()) or use strtotime(), however note that these methods do not support dates after January 19, 2038 on 32-bit systems due to overflow (the two methods do not support PHP’s automatic number variables promotion).

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

Sidebar

Related Questions

How can I make sure setup.py compiles projects PO files and include them whenever
Once you first build your BizTalk projects, the next time you go to make
I want to make one project that parse wiki pages and get needed information
For the longest time, one of the basic technical requirements for website projects I've
I would like to make a website where I can present some project of
I'm currently developing a website that will make use of PHP scripts and I'd
I'm trying to implement a jQuery slider into my website to make a projects
In a large website with lots of projects (meaning DLLs) that use each other
I want to do projects to make my resume more appealing to game companies.
How to make tags for multiple projects within one revision? For example, if it

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.