About Date in Mysql

Asked

Viewed 515 times

1

I’m doing a program for a college job, with a database connection.

On a table, I have a column NASCIMENTO of the kind DATE. On the show I have a MaskedTextBox to enter the date of birth, but I put our date medium, DD/MM/YYYY, and in the bank the standard is YYYY/MM/DD, how do I convert it? Because I’m not able to input the data, because of the difference.

It would be better to convert inside the INSERT from the bench or to do for the C#?

Example: I entered the date 12/04/1992, it has to be transformed in 1992/12/04 to be stored in the bank.

  • http://stackoverflow.com/questions/3477735/convert-datetime-to-string-formatyyyymmdd

2 answers

1

The default for Mysql is, AAAA/MM/DD, in this way, the ideal would be for you to convert INSERT of C#, which would give you a higher portability between banks, since this standard is almost for all banks.

0

  • I ended up changing in the bank to string even, vlw ^^

  • Working with Date when you start programming can be a bit tricky, but over time you get the hang of it. Don’t give up :P

Browser other questions tagged

You are not signed in. Login or sign up in order to post.