locked
Converting datepicker date to YYYY-MM-DD format? RRS feed

  • Question

  • I'm trying to convert the date format that is used by the DateTimePicker control (which I think is MM/DD/YYYY by default) to the format this is recognized by MySQL (which is the DateTime field format, which is YYYY-MM-DD HH:MM:SS).  I don't care so much about the HH:MM:SS as much as I do the date.

    I've tried specifying a custom format, but it stil doesn't seem to convert it properly on the Visual C# side.

    I've also tried the .ToString("YYYY-MM-DD") method, and it still doesn't seem to work properly.

    Any suggestions?   (as for the time stamp portion, I can just use 00:00:00 to indicate midnight because I don't care about that part.)

    • Moved by CoolDadTx Tuesday, October 1, 2013 9:20 PM Winforms related
    Tuesday, October 1, 2013 7:14 PM

Answers