DateTime problem

  • Thread starter Thread starter Timothy V
  • Start date Start date
T

Timothy V

Hi,
I'll simplify my problem by asking this.
If i have:
string tempS = DateTime.Now.ToString();
DateTime tempDT;

How do i store tempS into tempDT so that tempS = tempDT.ToString().

Thank you very much advance,

Tim.
 
Timothy said:
If i have:
string tempS = DateTime.Now.ToString();
DateTime tempDT;

How do i store tempS into tempDT so that tempS = tempDT.ToString().

Hi Timothy V,

use DateTime.Parse()

string tempS = DateTime.Now.ToString();
DateTime tempDT = DateTime.Parse(tempS);
MessageBox.Show(tempS);
MessageBox.Show(tempDT.ToString());

Cheers

Arne Janning
 
Good!

Arne Janning said:
Hi Timothy V,

use DateTime.Parse()

string tempS = DateTime.Now.ToString();
DateTime tempDT = DateTime.Parse(tempS);
MessageBox.Show(tempS);
MessageBox.Show(tempDT.ToString());

Cheers

Arne Janning
 
Back
Top