Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Small method to calculate since time
Message
From
10/10/2011 07:04:26
 
 
To
10/10/2011 06:53:30
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01525501
Message ID:
01525950
Views:
25
>>More possible improvements ? :
>>
>>Return a DateTimeSpan regardless of the parameter order.
>>i.e if first parameter is the later date still return the same difference (or possibly a 'negative' DateTimeSpan)
>>
>hmmm - I like the parameter order - one is supposed to know what one is doing - too much foxpro like
>
>Could add an optional parameter ( bool ) and work with min/max - but don't like that either
>
>A negative one - thought about that - add a sign ?
>
>>Make GetDateDiff logic available as an extension method of DateTime
>>e.g. DateTimeSpan dts = myDate.DateDiff(DateTime.Now);
>
>yes -
>
>When time permits - playtime is suspended - want that xbrl stuff out as soon as I can
>
>A change I did this morning - could not resist - was to make all the set-accessors private - seemed like a good thing to do
>
>And thinking about the negative DateTimeSpan - why not add addition/subtraction operators
>
>DateTimeSpan +/- DateTimeSpan
>DateTime +/- DateTimeSpan
>DateTimeOffset +/- DateTimeSpan
>
>And the unary minus
>
>
>And multiplication by an integer. John died at an early age, lived from 01/01/1800 to 15/09/1811. Matthew was born on 17/09/1909 - what is his date of decease knowing that he lived two times longer than John
>
>ie 17/09/1909 + 3 * DateTimeSpan(01/01/1800, 15/09/1811)
>
>And there must be other things to do I don't see at the moment: There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy
>
>But at the very least - it's an interesting excercise

Making the accessors private certainly sounds sensible and the other additions could also be useful. But maybe, as always, adding too much functionality can make it overweight an unneccessarily complex to use.........

Anyway I also have to do some real work - but it consists of exploring the use of WPF and Silverlight with cloud storage which should be interesting enough. I'd like to explore other providers but I've got an Azure account and the SDK so I'm just looking at MS first....

Any lurkers with an experiences on this ?
Previous
Reply
Map
View

Click here to load this message in the networking platform