Period Class
This class is used to represent a period of time
Definition
Namespace: EWSoftware.PDI
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2025.1.9.0
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2025.1.9.0
C#
[SerializableAttribute]
public class Period : IComparableVB
<SerializableAttribute>
Public Class Period
Implements IComparableC++
[SerializableAttribute]
public ref class Period : IComparableF#
[<SerializableAttribute>]
type Period =
class
interface IComparable
end- Inheritance
- Object Period
- Implements
- IComparable
Remarks
The class contains a property to specify a start date and properties for an end date and a
duration representing the difference between the two. Setting any property adjusts the others
accordingly.
Constructors
| Period | Default constructor |
| Period(Period) | Copy constructor |
| Period(String) | Construct a period from a string in ISO 8601 period format |
| Period(DateTime, Duration) | Construct a period from a start date and a duration |
| Period(DateTime, DateTime) | Construct a period from a start date and an end date |
Properties
| Duration | This is used to set or get the duration of the time period |
| EndDateTime | This is used to set or get the ending date/time of the period |
| Format | This is used to set the format used when the period is converted to its string format |
| StartDateTime | This is used to set or get the starting date/time of the period |
Methods
| Compare | Compares two Period values and returns an integer that indicates their relationship |
| CompareTo | Compares this instance to a specified object and returns an indication of their relative values |
| Equals(Object) |
This is overridden to allow proper comparison of Period objects
(Overrides ObjectEquals(Object)) |
| Equals(Period, Period) | Returns a value indicating whether two specified instances of Period are equal |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
| GetHashCode |
Get a hash code for the period object
(Overrides ObjectGetHashCode) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
| ToString |
Convert the period instance to its ISO 8601 string form
(Overrides ObjectToString) |
| TryParse | Construct a new Period object from a period specified in a string. Parameters specify the period and the variable where the new Period object is returned. |
Operators
| Equality(Period, Period) | Overload for equal operator |
| GreaterThan(Period, Period) | Overload for greater than operator |
| GreaterThanOrEqual(Period, Period) | Overload for greater than or equal operator |
| Inequality(Period, Period) | Overload for not equal operator |
| LessThan(Period, Period) | Overload for less than operator |
| LessThanOrEqual(Period, Period) | Overload for less than or equal operator |