vb.net:
I am trying to get a overall difference on two dates, I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, Seconds, no problems... What I cannot seem to figure out is how to get: 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. The hardest part of that, the part I cannot figure out, is the Month section... all the others are static, defined length components, but Months change, are all different... Help! anyone know how you do this? I am stuck... Thanks So Much for your Help! Atley
Yeah, I thought of that, but how do I decide what to delete from the total, based on how many months? [quoted text, click to view] "Lloyd Dupont" <net.galador@ld> wrote in message news:eM0imqO$DHA.212@TK2MSFTNGP12.phx.gbl... > what about getting the difference incerementally. > > 1st you get the difference in Year and substract it > 2nd you get the difference in month and substract it > 3rd .... (etc ...) > > "Atley" <atley_1@hotmail.com> wrote in message > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > I am trying to get a overall difference on two dates, > > > > I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, > > Seconds, no problems... > > > > What I cannot seem to figure out is how to get: > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > The hardest part of that, the part I cannot figure out, is the Month > > section... all the others are static, defined length components, but > Months > > change, are all different... > > > > Help! anyone know how you do this? I am stuck... > > > > Thanks So Much for your Help! > > > > Atley > > > > > >
Yea, but how would you do that in code, that will work for any dates put in? What I am saying is I can't find the constructs or methods that will do this effectively. [quoted text, click to view] "Lloyd Dupont" <net.galador@ld> wrote in message news:%23dfTeTP$DHA.4060@TK2MSFTNGP10.phx.gbl... > I don't get you. > > wether month have different lenght or you modify start or end date, the > result should be the same (I guess) > > like > 2 Feb (2) 2002 - 1st Jan (1) 2001 > = 1Y + (2 Feb 2001 - 1st Jan 2001) OR 1 year + (2 Feb 2002 - 1st Jan 2002) > = 1Y + 1M + (2 Jan 2001 - 1st Jan 2001) OR 1Y+1M+(2Feb2002-1stFeb2002) > = 1Y + 1M + 1D OR 1Y + 1M + 1D > > isn't it ? > > "Atley" <atley_1@hotmail.com> wrote in message > news:upYZC2O$DHA.3828@TK2MSFTNGP10.phx.gbl... > > Yeah, I thought of that, but how do I decide what to delete from the > total, > > based on how many months? > > > > > > > > > > > > "Lloyd Dupont" <net.galador@ld> wrote in message > > news:eM0imqO$DHA.212@TK2MSFTNGP12.phx.gbl... > > > what about getting the difference incerementally. > > > > > > 1st you get the difference in Year and substract it > > > 2nd you get the difference in month and substract it > > > 3rd .... (etc ...) > > > > > > "Atley" <atley_1@hotmail.com> wrote in message > > > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > > > I am trying to get a overall difference on two dates, > > > > > > > > I can get the difference in Years, Months, Weeks, Days, Hours, > Minutes, > > > > Seconds, no problems... > > > > > > > > What I cannot seem to figure out is how to get: > > > > > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > > > > > The hardest part of that, the part I cannot figure out, is the Month > > > > section... all the others are static, defined length components, but > > > Months > > > > change, are all different... > > > > > > > > Help! anyone know how you do this? I am stuck... > > > > > > > > Thanks So Much for your Help! > > > > > > > > Atley > > > > > > > > > > > > > > > > > > > >
I'm not sure I understand exactly what the problem is, but isn't it just something as simple as: Dim d1 As New Date(2006, 10, 20) Dim d2 As New Date(2003, 1, 9) Dim yDiff As Integer = d1.Year - d2.Year Dim mDiff As Integer = d1.Month - d2.Month Dim dDiff As Integer = d1.Day - d2.Day Or are you asking for something more complicated? Steven [quoted text, click to view] "Atley" <atley_1@hotmail.com> wrote in message news:%238wEnsP$DHA.3536@TK2MSFTNGP10.phx.gbl... > Yea, but how would you do that in code, that will work for any dates put in? > What I am saying is I can't find the constructs or methods that will do this > effectively. > > > > > "Lloyd Dupont" <net.galador@ld> wrote in message > news:%23dfTeTP$DHA.4060@TK2MSFTNGP10.phx.gbl... > > I don't get you. > > > > wether month have different lenght or you modify start or end date, the > > result should be the same (I guess) > > > > like > > 2 Feb (2) 2002 - 1st Jan (1) 2001 > > = 1Y + (2 Feb 2001 - 1st Jan 2001) OR 1 year + (2 Feb 2002 - 1st Jan 2002) > > = 1Y + 1M + (2 Jan 2001 - 1st Jan 2001) OR 1Y+1M+(2Feb2002-1stFeb2002) > > = 1Y + 1M + 1D OR 1Y + 1M + 1D > > > > isn't it ? > > > > "Atley" <atley_1@hotmail.com> wrote in message > > news:upYZC2O$DHA.3828@TK2MSFTNGP10.phx.gbl... > > > Yeah, I thought of that, but how do I decide what to delete from the > > total, > > > based on how many months? > > > > > > > > > > > > > > > > > > "Lloyd Dupont" <net.galador@ld> wrote in message > > > news:eM0imqO$DHA.212@TK2MSFTNGP12.phx.gbl... > > > > what about getting the difference incerementally. > > > > > > > > 1st you get the difference in Year and substract it > > > > 2nd you get the difference in month and substract it > > > > 3rd .... (etc ...) > > > > > > > > "Atley" <atley_1@hotmail.com> wrote in message > > > > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > > > > I am trying to get a overall difference on two dates, > > > > > > > > > > I can get the difference in Years, Months, Weeks, Days, Hours, > > Minutes, > > > > > Seconds, no problems... > > > > > > > > > > What I cannot seem to figure out is how to get: > > > > > > > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > > > > > > > The hardest part of that, the part I cannot figure out, is the Month > > > > > section... all the others are static, defined length components, but > > > > Months > > > > > change, are all different... > > > > > > > > > > Help! anyone know how you do this? I am stuck... > > > > > > > > > > Thanks So Much for your Help! > > > > > > > > > > Atley > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Thanks, but i can get the DateDiff several different ways, the problem is with the breakdown into how much time is left as a rundown ie 1 year, 2 months, 1 week, 3 days, 6 hours, 23 minutes, 41 seconds... "Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in message news:OK5fkhS$DHA.552@TK2MSFTNGP11.phx.gbl... [quoted text, click to view] > something like this? > > dim date1 as datetime > dim date2 as datetime > > dim ticks1 as long = date1.ticks > dim ticks2 as long = date2.ticks > > dim difference as new timespan(math.abs(ticks1 - ticks2)) > > > Dominique > > > > > "Atley" <atley_1@hotmail.com> wrote in message > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > I am trying to get a overall difference on two dates, > > > > I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, > > Seconds, no problems... > > > > What I cannot seem to figure out is how to get: > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > The hardest part of that, the part I cannot figure out, is the Month > > section... all the others are static, defined length components, but > Months > > change, are all different... > > > > Help! anyone know how you do this? I am stuck... > > > > Thanks So Much for your Help! > > > > Atley > > > > > >
Dominique, You know you can shorten that to: [quoted text, click to view] > dim date1 as datetime > dim date2 as datetime > > dim difference as timespan = date2.Subtract(date1)
Which assumes that date2 is after date1. Hope this helps Jay "Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in message news:OK5fkhS$DHA.552@TK2MSFTNGP11.phx.gbl... [quoted text, click to view] > something like this? > > dim date1 as datetime > dim date2 as datetime > > dim ticks1 as long = date1.ticks > dim ticks2 as long = date2.ticks > > dim difference as new timespan(math.abs(ticks1 - ticks2)) > > > Dominique > > > > > "Atley" <atley_1@hotmail.com> wrote in message > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > I am trying to get a overall difference on two dates, > > > > I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, > > Seconds, no problems... > > > > What I cannot seem to figure out is how to get: > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > The hardest part of that, the part I cannot figure out, is the Month > > section... all the others are static, defined length components, but > Months > > change, are all different... > > > > Help! anyone know how you do this? I am stuck... > > > > Thanks So Much for your Help! > > > > Atley > > > > > >
Dominique, How about Dim difference as TimeSpan = date2.Subtract(date1) difference = difference.Duration() ' correct to positive offset Now years is difference.Days/365 (ignoring leap year effects 365 days/year) Days = difference.Days Mod 365 hours, minutes and seconds are directly readable from the timespan. Ron Allen [quoted text, click to view] "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com> wrote in message news:epj3HxT$DHA.3188@TK2MSFTNGP09.phx.gbl... > Dominique, > You know you can shorten that to: > > > dim date1 as datetime > > dim date2 as datetime > > > > dim difference as timespan = date2.Subtract(date1) > > Which assumes that date2 is after date1. > > Hope this helps > Jay > > "Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in > message news:OK5fkhS$DHA.552@TK2MSFTNGP11.phx.gbl... > > something like this? > > > > dim date1 as datetime > > dim date2 as datetime > > > > dim ticks1 as long = date1.ticks > > dim ticks2 as long = date2.ticks > > > > dim difference as new timespan(math.abs(ticks1 - ticks2)) > > > > > > Dominique > > > > > > > > > > "Atley" <atley_1@hotmail.com> wrote in message > > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > > I am trying to get a overall difference on two dates, > > > > > > I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, > > > Seconds, no problems... > > > > > > What I cannot seem to figure out is how to get: > > > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > > > The hardest part of that, the part I cannot figure out, is the Month > > > section... all the others are static, defined length components, but > > Months > > > change, are all different... > > > > > > Help! anyone know how you do this? I am stuck... > > > > > > Thanks So Much for your Help! > > > > > > Atley > > > > > > > > > > > >
Ron, Yea that works, and that is pretty much what I was doing, except you have the exact same problem with months that I did. [quoted text, click to view] "Ron Allen" <rallen@_nospam_src-us.com> wrote in message news:%23EK2v7T$DHA.3536@TK2MSFTNGP10.phx.gbl... > Dominique, > How about > Dim difference as TimeSpan = date2.Subtract(date1) > difference = difference.Duration() ' correct to positive offset > Now years is difference.Days/365 (ignoring leap year effects 365 > days/year) > Days = difference.Days Mod 365 > hours, minutes and seconds are directly readable from the timespan. > > Ron Allen > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com> wrote in message > news:epj3HxT$DHA.3188@TK2MSFTNGP09.phx.gbl... > > Dominique, > > You know you can shorten that to: > > > > > dim date1 as datetime > > > dim date2 as datetime > > > > > > dim difference as timespan = date2.Subtract(date1) > > > > Which assumes that date2 is after date1. > > > > Hope this helps > > Jay > > > > "Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in > > message news:OK5fkhS$DHA.552@TK2MSFTNGP11.phx.gbl... > > > something like this? > > > > > > dim date1 as datetime > > > dim date2 as datetime > > > > > > dim ticks1 as long = date1.ticks > > > dim ticks2 as long = date2.ticks > > > > > > dim difference as new timespan(math.abs(ticks1 - ticks2)) > > > > > > > > > Dominique > > > > > > > > > > > > > > > "Atley" <atley_1@hotmail.com> wrote in message > > > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > > > I am trying to get a overall difference on two dates, > > > > > > > > I can get the difference in Years, Months, Weeks, Days, Hours, > Minutes, > > > > Seconds, no problems... > > > > > > > > What I cannot seem to figure out is how to get: > > > > > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > > > > > The hardest part of that, the part I cannot figure out, is the Month > > > > section... all the others are static, defined length components, but > > > Months > > > > change, are all different... > > > > > > > > Help! anyone know how you do this? I am stuck... > > > > > > > > Thanks So Much for your Help! > > > > > > > > Atley > > > > > > > > > > > > > > > > > > > >
Sweet... It works like a charm... you are the best! thanks for the help. "Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in message news:uSvUEgT$DHA.552@TK2MSFTNGP11.phx.gbl... [quoted text, click to view] > aha > you can do somthing like this... > > > > > dim date1 as datetime > > > dim date2 as datetime > > > > > > dim ticks1 as long = date1.ticks > > > dim ticks2 as long = date2.ticks > > > > Dim dt As New DateTime(math.abs(ticks1 - ticks2)) > Dim msg As String = "Differnce is:" & vbCrLf & _ > "years: " & (dt.Year - 1) & vbCrLf & _ > "months: " & (dt.Month - 1) & vbCrLf & _ > "days: " & (dt.Day - 1) & vbCrLf & _ > "hours: " & dt.Hour & vbCrLf & _ > "minutes: " & dt.Minute & vbCrLf & _ > "seconds: " & dt.Second > > doing -1 for year, month and day: > new datetime(ticks as long) -> gives you a date, not a timespan > and the date is calculated as the number of ticks since 01-01-0001 00:00:00 > so doing -1 for day, month and year gives you the remaining time for each > datetime part > > isn't that kewl :-) > > > something not so kewl > try this > date1 = now > date2 = date1.addYear(1) > > result everything 0 except for year... and day (also 1) > > tried a little with other "year-add's" > 90 -> year=90, day=1 > 99 -> year=99, day=0 > > wellwell, bug for small number of add years only? > or am I missing something? > > > > > > "Atley" <atley_1@hotmail.com> wrote in message > news:eY7io6S$DHA.3828@TK2MSFTNGP10.phx.gbl... > > Thanks, but i can get the DateDiff several different ways, the problem is > > with the breakdown into how much time is left as a rundown ie 1 year, 2 > > months, 1 week, 3 days, 6 hours, 23 minutes, 41 seconds... > > > > > > > > "Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in > > message news:OK5fkhS$DHA.552@TK2MSFTNGP11.phx.gbl... > > > something like this? > > > > > > dim date1 as datetime > > > dim date2 as datetime > > > > > > dim ticks1 as long = date1.ticks > > > dim ticks2 as long = date2.ticks > > > > > > dim difference as new timespan(math.abs(ticks1 - ticks2)) > > > > > > > > > Dominique > > > > > > > > > > > > > > > "Atley" <atley_1@hotmail.com> wrote in message > > > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > > > I am trying to get a overall difference on two dates, > > > > > > > > I can get the difference in Years, Months, Weeks, Days, Hours, > Minutes, > > > > Seconds, no problems... > > > > > > > > What I cannot seem to figure out is how to get: > > > > > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > > > > > The hardest part of that, the part I cannot figure out, is the Month > > > > section... all the others are static, defined length components, but > > > Months > > > > change, are all different... > > > > > > > > Help! anyone know how you do this? I am stuck... > > > > > > > > Thanks So Much for your Help! > > > > > > > > Atley > > > > > > > > > > > > > > > > > > > >
something like this? dim date1 as datetime dim date2 as datetime dim ticks1 as long = date1.ticks dim ticks2 as long = date2.ticks dim difference as new timespan(math.abs(ticks1 - ticks2)) Dominique [quoted text, click to view] "Atley" <atley_1@hotmail.com> wrote in message news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > I am trying to get a overall difference on two dates, > > I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, > Seconds, no problems... > > What I cannot seem to figure out is how to get: > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > The hardest part of that, the part I cannot figure out, is the Month > section... all the others are static, defined length components, but Months > change, are all different... > > Help! anyone know how you do this? I am stuck... > > Thanks So Much for your Help! > > Atley > >
Hi Atley, Did you look at the timespan.tickspersecond timespan.ticksperyear timespan.ticksperhour etc. I hope this helps, Cor
aha you can do somthing like this... [quoted text, click to view] > > dim date1 as datetime > > dim date2 as datetime > > > > dim ticks1 as long = date1.ticks > > dim ticks2 as long = date2.ticks > >
Dim dt As New DateTime(math.abs(ticks1 - ticks2)) Dim msg As String = "Differnce is:" & vbCrLf & _ "years: " & (dt.Year - 1) & vbCrLf & _ "months: " & (dt.Month - 1) & vbCrLf & _ "days: " & (dt.Day - 1) & vbCrLf & _ "hours: " & dt.Hour & vbCrLf & _ "minutes: " & dt.Minute & vbCrLf & _ "seconds: " & dt.Second doing -1 for year, month and day: new datetime(ticks as long) -> gives you a date, not a timespan and the date is calculated as the number of ticks since 01-01-0001 00:00:00 so doing -1 for day, month and year gives you the remaining time for each datetime part isn't that kewl :-) something not so kewl try this date1 = now date2 = date1.addYear(1) result everything 0 except for year... and day (also 1) tried a little with other "year-add's" 90 -> year=90, day=1 99 -> year=99, day=0 wellwell, bug for small number of add years only? or am I missing something? [quoted text, click to view] "Atley" <atley_1@hotmail.com> wrote in message news:eY7io6S$DHA.3828@TK2MSFTNGP10.phx.gbl... > Thanks, but i can get the DateDiff several different ways, the problem is > with the breakdown into how much time is left as a rundown ie 1 year, 2 > months, 1 week, 3 days, 6 hours, 23 minutes, 41 seconds... > > > > "Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in > message news:OK5fkhS$DHA.552@TK2MSFTNGP11.phx.gbl... > > something like this? > > > > dim date1 as datetime > > dim date2 as datetime > > > > dim ticks1 as long = date1.ticks > > dim ticks2 as long = date2.ticks > > > > dim difference as new timespan(math.abs(ticks1 - ticks2)) > > > > > > Dominique > > > > > > > > > > "Atley" <atley_1@hotmail.com> wrote in message > > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > > I am trying to get a overall difference on two dates, > > > > > > I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, > > > Seconds, no problems... > > > > > > What I cannot seem to figure out is how to get: > > > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > > > The hardest part of that, the part I cannot figure out, is the Month > > > section... all the others are static, defined length components, but > > Months > > > change, are all different... > > > > > > Help! anyone know how you do this? I am stuck... > > > > > > Thanks So Much for your Help! > > > > > > Atley > > > > > > > > > > > >
what about getting the difference incerementally. 1st you get the difference in Year and substract it 2nd you get the difference in month and substract it 3rd .... (etc ...) [quoted text, click to view] "Atley" <atley_1@hotmail.com> wrote in message news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > I am trying to get a overall difference on two dates, > > I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, > Seconds, no problems... > > What I cannot seem to figure out is how to get: > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > The hardest part of that, the part I cannot figure out, is the Month > section... all the others are static, defined length components, but Months > change, are all different... > > Help! anyone know how you do this? I am stuck... > > Thanks So Much for your Help! > > Atley > >
What is a year? What is a month? Peter Seaman
I don't get you. wether month have different lenght or you modify start or end date, the result should be the same (I guess) like 2 Feb (2) 2002 - 1st Jan (1) 2001 = 1Y + (2 Feb 2001 - 1st Jan 2001) OR 1 year + (2 Feb 2002 - 1st Jan 2002) = 1Y + 1M + (2 Jan 2001 - 1st Jan 2001) OR 1Y+1M+(2Feb2002-1stFeb2002) = 1Y + 1M + 1D OR 1Y + 1M + 1D isn't it ? [quoted text, click to view] "Atley" <atley_1@hotmail.com> wrote in message news:upYZC2O$DHA.3828@TK2MSFTNGP10.phx.gbl... > Yeah, I thought of that, but how do I decide what to delete from the total, > based on how many months? > > > > > > "Lloyd Dupont" <net.galador@ld> wrote in message > news:eM0imqO$DHA.212@TK2MSFTNGP12.phx.gbl... > > what about getting the difference incerementally. > > > > 1st you get the difference in Year and substract it > > 2nd you get the difference in month and substract it > > 3rd .... (etc ...) > > > > "Atley" <atley_1@hotmail.com> wrote in message > > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > > I am trying to get a overall difference on two dates, > > > > > > I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, > > > Seconds, no problems... > > > > > > What I cannot seem to figure out is how to get: > > > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > > > The hardest part of that, the part I cannot figure out, is the Month > > > section... all the others are static, defined length components, but > > Months > > > change, are all different... > > > > > > Help! anyone know how you do this? I am stuck... > > > > > > Thanks So Much for your Help! > > > > > > Atley > > > > > > > > > > > >
well I used the dateTime and not the TimeSpan just to have an easy way to find the years, months and days... [quoted text, click to view] "Ron Allen" <rallen@_nospam_src-us.com> wrote in message news:%23EK2v7T$DHA.3536@TK2MSFTNGP10.phx.gbl... > Dominique, > How about > Dim difference as TimeSpan = date2.Subtract(date1) > difference = difference.Duration() ' correct to positive offset > Now years is difference.Days/365 (ignoring leap year effects 365 > days/year) > Days = difference.Days Mod 365 > hours, minutes and seconds are directly readable from the timespan. > > Ron Allen > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com> wrote in message > news:epj3HxT$DHA.3188@TK2MSFTNGP09.phx.gbl... > > Dominique, > > You know you can shorten that to: > > > > > dim date1 as datetime > > > dim date2 as datetime > > > > > > dim difference as timespan = date2.Subtract(date1) > > > > Which assumes that date2 is after date1. > > > > Hope this helps > > Jay > > > > "Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in > > message news:OK5fkhS$DHA.552@TK2MSFTNGP11.phx.gbl... > > > something like this? > > > > > > dim date1 as datetime > > > dim date2 as datetime > > > > > > dim ticks1 as long = date1.ticks > > > dim ticks2 as long = date2.ticks > > > > > > dim difference as new timespan(math.abs(ticks1 - ticks2)) > > > > > > > > > Dominique > > > > > > > > > > > > > > > "Atley" <atley_1@hotmail.com> wrote in message > > > news:OIitcQO$DHA.2040@TK2MSFTNGP12.phx.gbl... > > > > I am trying to get a overall difference on two dates, > > > > > > > > I can get the difference in Years, Months, Weeks, Days, Hours, > Minutes, > > > > Seconds, no problems... > > > > > > > > What I cannot seem to figure out is how to get: > > > > > > > > 2 Years, 3 Months, 1 Week, 3 Days, 14 Hours, 21 Minutes, 33 Seconds. > > > > > > > > The hardest part of that, the part I cannot figure out, is the Month > > > > section... all the others are static, defined length components, but > > > Months > > > > change, are all different... > > > > > > > > Help! anyone know how you do this? I am stuck... > > > > > > > > Thanks So Much for your Help! > > > > > > > > Atley > > > > > > > > > > > > > > > > > > > >
Don't see what you're looking for? Try a search.
|