yusuf

yusuf

  • NA
  • 57
  • 0

About Datetime...

Nov 19 2007 7:57 PM

Hi everyone!

My problem is when the clock is for example 02.04.45, i cannot show number 0 with the code below. it always shows 2, not 02 and 4, not 04... how can i fix this?...

MessageBox.Show(DateTime.Now.Hour.ToString());
MessageBox.Show(DateTime.Now.Minute.ToString());

_____________________________________________________

 
it didnt work if i write it with these:
 

if ((Convert.ToString(DateTime.Now.Minute.ToString("mm")) == Convert.ToString(dak_textBox.Text).ToString())

{

if ((Convert.ToString(DateTime.Now.Hour.ToString("hh") == Convert.ToString(saat_textBox.Text)))

{

System.Diagnostics.Process.Start("shutdown", "-f -s");

}

}



i have to write a program which is switched off by the time the user want...


Answers (4)