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
285 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

Industry Leaders: 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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

719 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