Click or drag to resize

TimeUnitType Enumeration

Specifies the type of a time unit.

Namespace:  Aspose.Tasks
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.10
Syntax
public enum TimeUnitType
Members
  Member nameValueDescription
Undefined-1 Indicates Undefined value means that the field was not defined in original project file.
Minute0 Indicates Minute time unit type.
ElapsedMinute1 Indicates Elapsed minute time unit type.
Hour2 Indicates Hour time unit type.
ElapsedHour3 Indicates Elapsed hour time unit type.
Day4 Indicates Day time unit type.
ElapsedDay5 Indicates Elapsed day time unit type.
Week6 Indicates Week time unit type.
ElapsedWeek7 Indicates Elapsed week time unit type.
Month8 Indicates Month time unit type.
ElapsedMonth9 Indicates Elapsed month time unit type.
Percent10 Indicates Percent time unit type.
ElapsedPercent11 Indicates Elapsed percent time unit type.
Null12 Indicates Null time unit type.
MinuteEstimated13 Indicates Minute estimated time unit type.
ElapsedMinuteEstimated14 Indicates Elapsed minute estimated time unit type.
HourEstimated15 Indicates Hour estimated time unit type.
ElapsedHourEstimated16 Indicates Elapsed hour estimated time unit type.
DayEstimated17 Indicates Day estimated time unit type.
ElapsedDayEstimated18 Indicates Elapsed day estimated time unit type.
WeekEstimated19 Indicates Week estimated time unit type.
ElapsedWeekEstimated20 Indicates Elapsed week estimated time unit type.
MonthEstimated21 Indicates Month estimated time unit type.
ElapsedMonthEstimated22 Indicates Elapsed month estimated time unit type.
PercentEstimated23 Indicates Percent estimated time unit type.
ElapsedPercentEstimated24 Indicates Elapsed percent estimated time unit type.
Year25 Indicates Year time unit type.
Remarks
While exporting into XML the Undefined values will be eliminated from resulting XML.
Examples
Shows how to convert a duration into different time unit types.
var project = new Project(DataDir + "TaskDurations.mpp");

// Get a task to calculate its duration in different formats
var task = project.RootTask.Children.GetById(1);

// Get the duration in Minutes, Days, Hours, Weeks and Months
var mins = task.Get(Tsk.Duration).Convert(TimeUnitType.Minute).ToDouble();
Console.WriteLine("Duration in Mins: {0}", mins);
var days = task.Get(Tsk.Duration).Convert(TimeUnitType.Day).ToDouble();
Console.WriteLine("Duration in Days: {0}", days);
var hours = task.Get(Tsk.Duration).Convert(TimeUnitType.Hour).ToDouble();
Console.WriteLine("Duration in Hours: {0}", hours);
var weeks = task.Get(Tsk.Duration).Convert(TimeUnitType.Week).ToDouble();
Console.WriteLine("Duration in Weeks: {0}", weeks);
var months = task.Get(Tsk.Duration).Convert(TimeUnitType.Month).ToDouble();
Console.WriteLine("Duration in Months: {0}", months);
See Also