Solved

user enters datetime in M j, g:i A format, saved in mysql format and then displayed on the form again in M j, g:i A format

Posted on 2013-05-21
3
284 Views
Last Modified: 2013-05-22
a user is entering time in an input textbox which gets saved into mysql and then displayed in the input textbox again

datetime in this format:
M j, g:i A

Mar 10, 6:05 PM


want to convert
to mysql format
Y-m-d H:i:s

and then back into
M j, g:i A

how to do the two conversions
0
Comment
Question by:rgb192
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39186605
This should work.

$mysqldate = date("Y-m-d H:i:s", strtotime("Mar 10, 6:05 PM"));
$yourdate = date("M j, g:i A", strtotime("$mysqldate"));

Open in new window

0
 

Author Closing Comment

by:rgb192
ID: 39186744
thank you for organizing dates
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39186766
You're welcome.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question