Jon Skeet said:
So, what do you understand Alexander to mean by "TimeSpan is the same
base .NET type as DateTime"?
Well i try to define it (sorry for my bad English in advance)
1) Timespan is in fact a long (Int64) making most System.Convert methods to
able to convert it without any loss (following the same rules as Int64). ie
the Int64.ToTimeSpan (if existed) would be just a
return new TimeSpan(m_value);
IIRC the Int64.ToDateTime fails with an invalid cast error
(meaning Timespan is more IConvertible than DateTime<g>)
2) Operators Addition, Subtraction, Unary (already defined), multiplication
and division make sense on this Type (in contrast with DateTime), making
expressions (that using it) to carry no ambiguity to the reader
3) "base Types" (as OP said) defined in the TypeCode enumeration.
That enumeration defines a closed set of types, any operation between those
types must accept or return a type that is already defined in that set.
That rule (orthogonal) is breaking by TimeSpan type (or DateTime type)
since operations on DateTime (+ and - ) require a TimeSpan
CLR tries to correct this breaking rule, in some persistence frameworks :
4) System.Data.DataColumn.DataType
Accepted types are "base types" + TimeSpan
5) System.XML.XMLConvert
Converts from/to "base types" + TimeSpan