Solved

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

Posted on 2014-12-15
2
111 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
Comment Utility
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
Comment Utility
that worked - I guess 1 is 24 hr and 1 is 12
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now