FlyBoy Posted September 13, 2004 Posted September 13, 2004 (edited) dates is this a good way to compare dates? chk = (dt.AddDays(30).ToString < Date.Now.ToString) i hope its comparing the dates and not the string length...as i think. but the final result is ok..(i guess) the dt date is a date which i took out from a file. im trying to make a time evaluation... Edited September 13, 2004 by FlyBoy Quote
Administrators PlausiblyDamp Posted September 13, 2004 Administrators Posted September 13, 2004 You don't need to convert to strings to compare dates - just compare the dates: chk = (dt.AddDays(30) < Date.Now) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
FlyBoy Posted September 13, 2004 Author Posted September 13, 2004 You don't need to convert to strings to compare dates - just compare the dates: chk = (dt.AddDays(30) < Date.Now) i've tried that ....and it didnt work. but somehow now it works...maybe it was someting with my syntax which i havent noticed. thanks!!!! btw...when i should use the "timespan" thing?? read about it in msdn...but still cant figure it out. :confused: :confused: Quote
Administrators PlausiblyDamp Posted September 13, 2004 Administrators Posted September 13, 2004 You would use a timespan if you need to keep track of an arbitrary range of time (like the difference between two dates) Dim ts As TimeSpan ts = dt.AddDays(30).Subtract(Date.Now) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
FlyBoy Posted September 13, 2004 Author Posted September 13, 2004 You would use a timespan if you need to keep track of an arbitrary range of time (like the difference between two dates) Dim ts As TimeSpan ts = dt.AddDays(30).Subtract(Date.Now) i see...thank u very very much!! Quote
*Experts* DiverDan Posted September 15, 2004 *Experts* Posted September 15, 2004 It looks like you might be setting up a 30-day demo of your software. If so you might also consider using a Julian date to eliminate any international date format problems and save a value rather than a date using CInt(Now().ToOADate). Then just subtract the current day value from the installation value. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.