Share via

Problem to Date time field

Scott Huang 3,511 Reputation points
2023-06-28T04:56:44.3766667+00:00
Hi,
I have the code like
                        to_dt_val = tb_valid_to.Text.Trim() + " 12:00:00 AM";
                        cmd4.Parameters.Add("@dt0", SqlDbType.DateTime).Value = DateTime.ParseExact(to_dt_val, to_dt_format, CultureInfo.InvariantCulture);

it is having the time (on the day) shown on the page. But the time part disappears when I put the cursor on the field and leave the field. How to resolve it?

Developer technologies | ASP.NET Core | Other

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.