Solved

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

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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

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