How can I use the 'DateTime.Now' function to put a realtime Digital clock in a GUI label? Pls help... ??? ???
Create a GUI label (named Clock here) and put this in the rep-exec:
DateTime *dt = DateTime.Now;
Clock.Text = String.Format("%02d:%02d:%02d", dt.Hour, dt.Minute, dt.Second);
I've never used the daytime but that should work.
Thanks, I tried to put it in myself but it kept saying "Parse error" and "expected ';'
Is that parser error directed to one of those two lines? I can't see a problem.
Could you show some more of your code? Maybe there's a mistake before or after the lines.
No, I meant when I tried it on my own, I used;
Clock.Text = "%02d:%02d:%02d", dt.hour etc.
Quote from: AGSPwnage on Sat 16/10/2010 13:20:09
No, I meant when I tried it on my own, I used;
Clock.Text = "%02d:%02d:%02d", dt.hour etc.
Notice the String.format command.
Quote from: AGSPwnage on Sat 16/10/2010 13:20:09
No, I meant when I tried it on my own, I used;
Clock.Text = "%02d:%02d:%02d", dt.hour etc.
Yes, you see you didn't copy Matti's line verbatum. Check yours with Matti's you'll spot the difference. ;)
Hey, hahaha, he tried it on his own, and due to leaving out a negligible part of the code, he suddenly got a parsing error, hahaha! :D
Sorry, but this just made my day.
"To bake the pizza, put it in the oven."
-10 minutes later-
"Why is my pizza still cold and tastes raw? I tried it on my own and put it in the fridge."
This Is what I done before I asked the AGSFrorums, I had forgotten about the forums...
Sorry pal, I found it hilarious. Didn't mean to be rude.
Np
Quote from: AGSPwnage on Sat 16/10/2010 19:20:34
This Is what I done before I asked the AGSFrorums, I had forgotten about the forums...
For some reason this quote just makes me think of Frmomo Baggminz (http://en.wikipedia.org/wiki/Frodo_Baggins).
But enough off-topic harassment for one day. :=
Lol :D