Solved

mysql datetime enters 'AM' when I update after 12 pm?

Posted on 2014-12-15
2
123 Views
Last Modified: 2014-12-15
I use a datetime picker to set the date but when I select it and the time on my pc is after 12:00 pm it returns it from the database as 12/15/2014 1:38:06 AM - it should be PM

string expecteddate = dtppExpectedArrivalDate.Value.ToString("yyyy-MM-dd hh:mm:ss");
                    string sentdate = dtpSentDate.Value.ToString("yyyy-MM-dd hh:mm:ss");
0
Comment
Question by:r3nder
2 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 500 total points
ID: 40501238
that is unusual. Can you show the string shown in expectdate and sentdate? most likely, you want capital H's for the hour string. Try this:

string sentdate = dtpSentDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
0
 
LVL 6

Author Closing Comment

by:r3nder
ID: 40501272
that worked - I guess 1 is 24 hr and 1 is 12
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

829 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