Format time string

G

grant

Good day,

I have been trying to understand cultures and formatProviders etc but I cant
get on top of this simple problem:
I have a text box displaying "07:15" - how do I convert that string to a
DateTime format so that I can get it into the database?
It is an Access database with a data type of Date/Time formatted as 'Medium
Time' which is hh:mm AM/PM

Thank you.
Grant
 
A

Arne Vajhøj

grant said:
I have been trying to understand cultures and formatProviders etc but I cant
get on top of this simple problem:
I have a text box displaying "07:15" - how do I convert that string to a
DateTime format so that I can get it into the database?
It is an Access database with a data type of Date/Time formatted as 'Medium
Time' which is hh:mm AM/PM

DateTime.ParseExact

or

DateTime.TryParseExact

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top