Convert DateTime to string?

T

Tony

DateTime today;
today=today.Date;
MessageBox.Show(today);

Fails because Cannot Convert System.DateTime to string


I've tried MessageBox.Show((string)today);

But that didn't work either.

How would I modify it so I can snag the current Date/Time in a string?

Thanks,,

Tony!
 
J

John Baro

MessageBox.Show(today.ToString())

DateTime has a number of in-built string conversion functions
shortdate
longdate
time???
etc...

HTH
JB
 
T

Tony

Thanks!... That did the trick! :)

Tony!


MessageBox.Show(today.ToString())

DateTime has a number of in-built string conversion functions
shortdate
longdate
time???
etc...

HTH
JB
 

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