# DateTimeExtensionMethods class

Namespace: [Grasshopper2.Extensions](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.extensions.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public static class DateTimeExtensionMethods
```

Provides extension methods for some date/time modifications.

## Methods

- [HourFactor](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.datetimeextensionmethods/hourfactor.md): (static) Gets the normalised factor into the current hour.
- [HourSpan](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.datetimeextensionmethods/hourspan.md): (static) Gets the timespan into the current hour.
- [MinuteFactor](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.datetimeextensionmethods/minutefactor.md): (static) Gets the normalised factor into the current minute.
- [MinuteSpan](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.datetimeextensionmethods/minutespan.md): (static) Gets the timespan into the current minute.
- [SecondFactor](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.datetimeextensionmethods/secondfactor.md): (static) Gets the normalised factor into the current second.
- [SecondSpan](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.datetimeextensionmethods/secondspan.md): (static) Gets the timespan into the current second.
- [ToAgeString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.datetimeextensionmethods/toagestring.md): (static) Format the age of a time span.
- [ToDateTime](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.datetimeextensionmethods/todatetime.md): (static) Convert a floating point number into a DateTime instance counting the days since January 1st 2020. Note that overflow will be handled by returning a DateTime.MinValue or DateTime.MaxValue.
- [ToNumber](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.datetimeextensionmethods/tonumber.md): (2 overloads, static) Convert a DateTime into a floating point number counting the days since January 1st 2020.
- [ToTimeSpan](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.datetimeextensionmethods/totimespan.md): (static) Convert a floating point number into a TimeSpan instance using total days. Note that overflow will be handled by returning a TimeSpan.MinValue or TimeSpan.MaxValue.
