DateTimeExtensionMethods
Provides extension methods for some date/time modifications.
Methods
Gets the normalised factor into the current hour.
Parameters:
| time (DateTime) | Time to measure. |
Returns: Normalised factor.
Gets the timespan into the current hour.
Parameters:
| time (DateTime) | Time to measure. |
Returns: Timespan. Always between zero and one hour.
Gets the normalised factor into the current minute.
Parameters:
| time (DateTime) | Time to measure. |
Returns: Normalised factor.
Gets the timespan into the current minute.
Parameters:
| time (DateTime) | Time to measure. |
Returns: Timespan. Always between zero and one minute.
Gets the normalised factor into the current second.
Parameters:
| time (DateTime) | Time to measure. |
Returns: Normalised factor.
Gets the timespan into the current second.
Parameters:
| time (DateTime) | Time to measure. |
Returns: Timespan. Always between zero and one second.
Format the age of a time span.
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.
Parameters:
| number (double) | Number to convert. |
Convert a DateTime into a floating point number counting the days since January 1st 2020.
Parameters:
| date (DateTime) | Date to convert. |
Returns: Number. Note it may be negative.
Convert a TimeSpan into a floating point number counting the total number of days.
Parameters:
| time (TimeSpan) | Time to convert. |
Returns: Number. Note it may be negative.