1Likes
-
1
Post By techblitz
-
I'm an absolute beginner too but I had a go at making an app that counts the number of days since something, thanks to one of the tutorials in the video series I posted above but I changed it up a bit
I also chucked in an if statement just for practice. I couldn't figure out how to get the date to show just the days though. If anyone knows how to change that, it would be much appreciated. Heres my code:
string message;
if (textBox1.Text == "24/03/1995")
{
message = "test
";
}
else
{
DateTime myBirthday = DateTime.Parse(textBox1.Text);
TimeSpan myAge = DateTime.Now.Subtract(myBirthday);
message = myAge.ToString();
}
myTextBlock.Text = String.Format("{0}", message);
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Copyright © 2013 Neverstill