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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:12:21+00:00 2026-06-16T00:12:21+00:00

After spending over 6 hours trying to do this and trying many different published

  • 0

After spending over 6 hours trying to do this and trying many different published solutions I am just going to ask the exact question.

I want to have the user enter the date and time in US format in an html form. Format for today is 12/16/2012 02:53 using 24 hour time format.

Lets call it start_date.

Then I want to insert the record including the start_date into an mysql database into a datetime type field.
I am using PHP 5.2. Many of the solutions I saw required 5.3 and none of the workarounds for 5.2 worked.

Can someone please give me an exact example.
Thank you.

  • 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-16T00:12:22+00:00Added an answer on June 16, 2026 at 12:12 am

    You asked for an example, which no one has supplied yet, so here it is:-

    $start_date = date("Y-m-d H:i:s", strtotime("12/16/2012 02:53"));
    echo $start_date;
    

    Output:-

    2012-12-16 02:53:00
    

    This format matches the MySql DateTime type.

    See working example here which also demonstrates that it works in PHP 5.2.

    See the manual for strtotime and date.

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

Sidebar

Related Questions

Edit After spending several hours on this and working with @pst, it turns out
After spending roughly two days on this, I'm getting a little rattled. Although by
I'm trying to automate many repetitive tasks at work and this small problem got
After spending few hours on the internet to find about push notification system for
This may seem an old question, but I didn't find an exhaustive answer after
This is a complete noob question, but I gotta ask it anyway I started
After spending several hours today searching and seeing several people having the same issue,
After spending three weeks learning Objective-C and Cocoa programming for my work, I've been
After spending a miserable month with MySQL/.NET/EntityFramework, my findings: Support for Entity Framework is
After spending some time wireframing my ideas, I want to start building my rails

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.