![]() |
Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
|
Represents a duration value, as defined by the xsd:duration data type: http://www.w3.org/TR/xmlschema-2/#duration More...
Public Member Functions | |
| Duration (bool Negation, int Years, int Months, int Days, int Hours, int Minutes, double Seconds) | |
| Represents a duration value, as defined by the xsd:duration data type: http://www.w3.org/TR/xmlschema-2/#duration More... | |
| Duration (string s) | |
| Represents a duration value, as defined by the xsd:duration data type: http://www.w3.org/TR/xmlschema-2/#duration More... | |
| override bool | Equals (object obj) |
| override int | GetHashCode () |
| override string | ToString () |
| int | CompareTo (Duration other) |
| Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. More... | |
| Duration | Negate () |
| Negates the duration. More... | |
Static Public Member Functions | |
| static Duration | Parse (string s) |
| Parses a duration from its string representation. More... | |
| static bool | TryParse (string s, out Duration Result) |
| Tries to parse a duration value. More... | |
| static System.DateTime | operator+ (System.DateTime Timepoint, Duration Offset) |
| Adds a duration to a System.DateTime value. More... | |
| static System.DateTime | operator- (System.DateTime Timepoint, Duration Offset) |
| Subtracts a duration from a System.DateTime value. More... | |
| static bool | operator< (Duration D1, Duration D2) |
| Checks if duration D1 is less than duration D2 . More... | |
| static bool | operator<= (Duration D1, Duration D2) |
| Checks if duration D1 is less than or equal to duration D2 . More... | |
| static bool | operator> (Duration D1, Duration D2) |
| Checks if duration D1 is greater than duration D2 . More... | |
| static bool | operator>= (Duration D1, Duration D2) |
| Checks if duration D1 is greater than or equal to duration D2 . More... | |
| static bool | operator== (Duration D1, Duration D2) |
| Checks if duration D1 is equal to duration D2 . More... | |
| static bool | operator!= (Duration D1, Duration D2) |
| Checks if duration D1 is not equal to duration D2 . More... | |
| static Duration | operator+ (Duration D1, Duration D2) |
| Adds two durations. More... | |
| static Duration | operator- (Duration D1, Duration D2) |
| Adds two durations. More... | |
| static Duration | operator* (int Scalar, Duration D) |
| Scalar multiplication of an integer and a duration. More... | |
| static Duration | operator* (Duration D, int Scalar) |
| Scalar multiplication of a duration and an integer. More... | |
| static Duration | FromYears (int Years) |
| Creates a Duration object from a given number of years. More... | |
| static Duration | FromMonths (int Months) |
| Creates a Duration object from a given number of months. More... | |
| static Duration | FromDays (int Days) |
| Creates a Duration object from a given number of days. More... | |
| static Duration | FromHours (int Hours) |
| Creates a Duration object from a given number of hours. More... | |
| static Duration | FromMinutes (int Minutes) |
| Creates a Duration object from a given number of minutes. More... | |
| static Duration | FromSeconds (int Seconds) |
| Creates a Duration object from a given number of seconds. More... | |
| static Duration | FromTimeSpan (System.TimeSpan TS) |
| Converts a TimeSpan to a Duration. (This will loose milliseconds.) More... | |
| static Duration | GetDurationBetween (System.DateTime From, System.DateTime To) |
| Calculates the duration between two dates. More... | |
Static Public Attributes | |
| static readonly Duration | Zero = new Duration(false, 0, 0, 0, 0, 0, 0) |
| Zero value More... | |
Properties | |
| int | Years [get, set] |
| Number of years. More... | |
| int | Months [get, set] |
| Number of months. More... | |
| int | Days [get, set] |
| Number of days. More... | |
| int | Hours [get, set] |
| Number of hours. More... | |
| int | Minutes [get, set] |
| Number of minutes. More... | |
| double | Seconds [get, set] |
| Number of seconds. More... | |
| bool | Negation [get, set] |
| If the duration is negative (true) or positive (false). More... | |
Represents a duration value, as defined by the xsd:duration data type: http://www.w3.org/TR/xmlschema-2/#duration
Definition at line 13 of file Duration.cs.
| Waher.Content.Duration.Duration | ( | bool | Negation, |
| int | Years, | ||
| int | Months, | ||
| int | Days, | ||
| int | Hours, | ||
| int | Minutes, | ||
| double | Seconds | ||
| ) |
Represents a duration value, as defined by the xsd:duration data type: http://www.w3.org/TR/xmlschema-2/#duration
| Negation | If the duration is negative (true) or positive (false). |
| Years | Number of years. |
| Months | Number of months. |
| Days | Number of days. |
| Hours | Number of hours. |
| Minutes | Number of minutes. |
| Seconds | Number of seconds. |
Definition at line 36 of file Duration.cs.
| Waher.Content.Duration.Duration | ( | string | s | ) |
Represents a duration value, as defined by the xsd:duration data type: http://www.w3.org/TR/xmlschema-2/#duration
| s | String representation of duration. |
Definition at line 52 of file Duration.cs.
| int Waher.Content.Duration.CompareTo | ( | Duration | other | ) |
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
| other | An object to compare with this instance. |
Definition at line 664 of file Duration.cs.
| override bool Waher.Content.Duration.Equals | ( | object | obj | ) |
Definition at line 501 of file Duration.cs.
|
static |
Creates a Duration object from a given number of days.
| Days | Number of days. |
Definition at line 604 of file Duration.cs.
|
static |
Creates a Duration object from a given number of hours.
| Hours | Number of hours. |
Definition at line 614 of file Duration.cs.
|
static |
Creates a Duration object from a given number of minutes.
| Minutes | Number of minutes. |
Definition at line 624 of file Duration.cs.
|
static |
Creates a Duration object from a given number of months.
| Months | Number of months. |
Definition at line 594 of file Duration.cs.
|
static |
Creates a Duration object from a given number of seconds.
| Seconds | Number of seconds. |
Definition at line 634 of file Duration.cs.
|
static |
Converts a TimeSpan to a Duration. (This will loose milliseconds.)
| TS | TimeSpan value. |
Definition at line 644 of file Duration.cs.
|
static |
Creates a Duration object from a given number of years.
| Years | Number of years. |
Definition at line 584 of file Duration.cs.
|
static |
Calculates the duration between two dates.
| From | Starting point. |
| To | Ending point. |
Definition at line 694 of file Duration.cs.
| override int Waher.Content.Duration.GetHashCode | ( | ) |
Definition at line 510 of file Duration.cs.
| Duration Waher.Content.Duration.Negate | ( | ) |
Checks if duration D1 is not equal to duration D2 .
Definition at line 376 of file Duration.cs.
Scalar multiplication of a duration and an integer.
| D | Duration |
| Scalar | Integer scalar. |
Definition at line 495 of file Duration.cs.
Scalar multiplication of an integer and a duration.
| Scalar | Integer scalar. |
| D | Duration |
Definition at line 460 of file Duration.cs.
|
static |
Adds a duration to a System.DateTime value.
| Timepoint | System.DateTime value. |
| Offset | Offset. |
Definition at line 196 of file Duration.cs.
|
static |
Subtracts a duration from a System.DateTime value.
| Timepoint | System.DateTime value. |
| Offset | Offset. |
Definition at line 248 of file Duration.cs.
Checks if duration D1 is less than duration D2 .
Definition at line 300 of file Duration.cs.
Checks if duration D1 is less than or equal to duration D2 .
Definition at line 314 of file Duration.cs.
Checks if duration D1 is equal to duration D2 .
Definition at line 356 of file Duration.cs.
Checks if duration D1 is greater than duration D2 .
Definition at line 328 of file Duration.cs.
Checks if duration D1 is greater than or equal to duration D2 .
Definition at line 342 of file Duration.cs.
|
static |
Parses a duration from its string representation.
| s | String representation of duration. |
| ArgumentException | If s does not represent a valid duration. |
Definition at line 72 of file Duration.cs.
| override string Waher.Content.Duration.ToString | ( | ) |
Definition at line 516 of file Duration.cs.
|
static |
Tries to parse a duration value.
| s | String |
| Result | Duration, if successful. |
Definition at line 86 of file Duration.cs.
Zero value
Definition at line 577 of file Duration.cs.
|
getset |
Number of days.
Implements Waher.Script.Functions.DateAndTime.IDays.
Definition at line 148 of file Duration.cs.
|
getset |
Number of hours.
Implements Waher.Script.Functions.DateAndTime.IHours.
Definition at line 157 of file Duration.cs.
|
getset |
Number of minutes.
Implements Waher.Script.Functions.DateAndTime.IMinutes.
Definition at line 166 of file Duration.cs.
|
getset |
Number of months.
Implements Waher.Script.Functions.DateAndTime.IMonths.
Definition at line 139 of file Duration.cs.
|
getset |
If the duration is negative (true) or positive (false).
Definition at line 184 of file Duration.cs.
|
getset |
Number of seconds.
Implements Waher.Script.Functions.DateAndTime.ISeconds.
Definition at line 175 of file Duration.cs.
|
getset |
Number of years.
Implements Waher.Script.Functions.DateAndTime.IYears.
Definition at line 130 of file Duration.cs.