First of all storing hours, minutes, and AM/PM is not sufficient to
correctly reproduce a DateTime object.
public DateTime (int year,int month,int day,int hour,int minute,int
second,int millisecond)
Since in the database you are also storing AM/PM, so I assume you are
storing hours in 12 hour format. So before calling DateTime constructor, set
the hour field to 24 hours format.
If (PM) { hour = (hr_from_DB < 12 ? (hr_from_DB + 12) : 0) ); } <- Note that
the day field will still be wrong.
DateTime dt = new DateTime(System.DateTime.Today.Year,
System.DateTime.Today.Month, System.DateTime.Today.Day, hour, 50, 0, 0);
"Mohan" <ka******@gmail.com> wrote in message
news:11**********************@x69g2000cwx.googlegr oups.com...
In the database, we are storing time in 3 columns: hours, Minutes and
AM,PM.
After retrieving it from the database, I want to load these values into
a DateTime variable. I haven't had much success.
I would appreciate if anyone can help me in this matter
thank you
MB