IT-Academy

C# cas

Mar 30th, 2015
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1.  
  2.             hodiny = DateTime.UtcNow.Hour + 1;
  3.             minuty = DateTime.UtcNow.Minute;
  4.             sekundy = DateTime.UtcNow.Second;
  5.  
  6.             String cas = "";
  7.  
  8.             if (hodiny < 10)
  9.             {
  10.                 cas += "0" + hodiny;
  11.             }
  12.             else
  13.             {
  14.                 cas += hodiny;
  15.             }
  16.             cas += ":";
  17.  
  18.             if (minuty < 10)
  19.             {
  20.                 cas += "0" + minuty;
  21.             }
  22.             else
  23.             {
  24.                 cas += minuty;
  25.             }
  26.             cas += ":";
  27.  
  28.             if (sekundy < 10)
  29.             {
  30.                 cas += "0" + sekundy;
  31.             }
  32.             else
  33.             {
  34.                 cas += sekundy;
  35.             }
  36.  
  37.             lblCas.Text = cas;
Advertisement
Add Comment
Please, Sign In to add comment