Solved

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

Posted on 2014-12-15
2
127 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
[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 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

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