converting date string into datetime object

G

Glenn M

I have a date stored as a string in the format mm/dd/yyyy.
What is the easiest way to get this date converted to a datetime
object so i can include it in the datediff function.

also what is the method i should use to return a date string back from
the datatime object, possibly in a different format such as dd/mm/yyyy

glenn
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (Glenn M) scripsit:
I have a date stored as a string in the format mm/dd/yyyy.
What is the easiest way to get this date converted to a datetime
object so i can include it in the datediff function.
'DateTime.Parse'/'DateTime.ParseExact'.

also what is the method i should use to return a date string back from
the datatime object, possibly in a different format such as dd/mm/yyyy

'DateTime.ToString'.
 

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