Stranger
Stranger

Reputation: 862

DatetimePicker automatic conversion C#

I am using C# and I am setting the value of the date time picker to my date from my database. But the format I have in database is different from the format of the Date Time Picker. Is there a way to automatically change the format of my database date to that of the date time picker. I have searched for it but I haven't found it.

I will appreciate your help.

Upvotes: 0

Views: 226

Answers (1)

Oded
Oded

Reputation: 498992

But the format I have in database is different from the format of the Date Time Picke

You are making the mistake of thinking the database has any associated display format when storing a DATETIME - it doesn't - there is an internal representation. All you see is how the date is represented when you view it in some tool.

If your database uses a DATETIME column, as it should, then there is not issue.

Upvotes: 2

Related Questions