Is it possible to extend the system classes?
I want to create a function for converting a DateTime into a TimeSpan.
Any Ideas?
at the moment i've created:
public class Convert
{
public static TimeSpan DateTimeToTimeS pan(DateTime value)
{
return new TimeSpan(value. Hour, value.Minute,
value.Second);
}
}
But I like a funtction like:
DateTime inputVar
Timestamp outputVar= inputVar.GetTim eStamp
is this possible? Just extending the systemclass.
thnx
I want to create a function for converting a DateTime into a TimeSpan.
Any Ideas?
at the moment i've created:
public class Convert
{
public static TimeSpan DateTimeToTimeS pan(DateTime value)
{
return new TimeSpan(value. Hour, value.Minute,
value.Second);
}
}
But I like a funtction like:
DateTime inputVar
Timestamp outputVar= inputVar.GetTim eStamp
is this possible? Just extending the systemclass.
thnx
Comment