Version

TimeOfDayToExcelDate Method

Converts a TimeSpan to Excel's numerical representation of a date.
Syntax
public static double TimeOfDayToExcelDate( 
   TimeSpan timeValue,
   bool useDayInfo
)

Parameters

timeValue
The TimeSpan value to convert to the Microsoft Excel date format.
useDayInfo
Optional parameter to allow the day information to be included as well.
Remarks

The TimeSpan.Days portion of the timeValue will not be used unless the useDayInfo is true. Otherwise only the time of day will be used from the TimeSpan.

Requirements

Target Platforms: Android 4.4+, iOS 8+

Development Environments: Visual Studio 2015+, Visual Studio for Mac Preview, Xamarin for Visual Studio 4.2+

See Also