|
-
Jun 22nd, 2015, 06:23 AM
#1
Thread Starter
Junior Member
[RESOLVED] datediff function not working
I have a string called datestring which contains the string "23, 06, 2015"
I was trying to use the DateDiff and Parseexact function to find the number of days between today see if i could get the program to fetch the number of days between today (the 22nd) and the string, however it always produces -149 and i don't know why. Here's my code:
Dim tempdate as string = "23, 06, 2015"
Dim tempdate As Date = Date.ParseExact(teststring, "dd, mm, yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)
RichTextBox1.Text = DateDiff("d", Date.Today, tempdate)
the rich textbox should be producing 1 but it always produces -149 and i don't know why
-
Jun 22nd, 2015, 06:32 AM
#2
Re: datediff function not working
I think the problem is that mm refers to minutes. You want MM instead.
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
Tags for this Thread
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
|
Click Here to Expand Forum to Full Width
|