![]() |
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 | 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 12 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 35 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 51 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 619 of file Duration.cs.
override bool Waher.Content.Duration.Equals | ( | object | obj | ) |
Definition at line 454 of file Duration.cs.
|
static |
Creates a Duration object from a given number of days.
Days | Number of days. |
Definition at line 559 of file Duration.cs.
|
static |
Creates a Duration object from a given number of hours.
Hours | Number of hours. |
Definition at line 569 of file Duration.cs.
|
static |
Creates a Duration object from a given number of minutes.
Minutes | Number of minutes. |
Definition at line 579 of file Duration.cs.
|
static |
Creates a Duration object from a given number of months.
Months | Number of months. |
Definition at line 549 of file Duration.cs.
|
static |
Creates a Duration object from a given number of seconds.
Seconds | Number of seconds. |
Definition at line 589 of file Duration.cs.
|
static |
Converts a TimeSpan to a Duration. (This will loose milliseconds.)
TS | TimeSpan value. |
Definition at line 599 of file Duration.cs.
|
static |
Creates a Duration object from a given number of years.
Years | Number of years. |
Definition at line 539 of file Duration.cs.
|
static |
Calculates the duration between two dates.
From | Starting point. |
To | Ending point. |
Definition at line 649 of file Duration.cs.
override int Waher.Content.Duration.GetHashCode | ( | ) |
Definition at line 463 of file Duration.cs.
Duration Waher.Content.Duration.Negate | ( | ) |
Checks if duration D1 is not equal to duration D2 .
Definition at line 375 of file Duration.cs.
|
static |
Adds a duration to a System.DateTime value.
Timepoint | System.DateTime value. |
Offset | Offset. |
Definition at line 195 of file Duration.cs.
|
static |
Subtracts a duration from a System.DateTime value.
Timepoint | System.DateTime value. |
Offset | Offset. |
Definition at line 247 of file Duration.cs.
Checks if duration D1 is less than duration D2 .
Definition at line 299 of file Duration.cs.
Checks if duration D1 is less than or equal to duration D2 .
Definition at line 313 of file Duration.cs.
Checks if duration D1 is equal to duration D2 .
Definition at line 355 of file Duration.cs.
Checks if duration D1 is greater than duration D2 .
Definition at line 327 of file Duration.cs.
Checks if duration D1 is greater than or equal to duration D2 .
Definition at line 341 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 71 of file Duration.cs.
override string Waher.Content.Duration.ToString | ( | ) |
Definition at line 471 of file Duration.cs.
|
static |
Tries to parse a duration value.
s | String |
Result | Duration, if successful. |
Definition at line 85 of file Duration.cs.
Zero value
Definition at line 532 of file Duration.cs.
|
getset |
Number of days.
Implements Waher.Script.Functions.DateAndTime.IDays.
Definition at line 147 of file Duration.cs.
|
getset |
Number of hours.
Implements Waher.Script.Functions.DateAndTime.IHours.
Definition at line 156 of file Duration.cs.
|
getset |
Number of minutes.
Implements Waher.Script.Functions.DateAndTime.IMinutes.
Definition at line 165 of file Duration.cs.
|
getset |
Number of months.
Implements Waher.Script.Functions.DateAndTime.IMonths.
Definition at line 138 of file Duration.cs.
|
getset |
If the duration is negative (true) or positive (false).
Definition at line 183 of file Duration.cs.
|
getset |
Number of seconds.
Implements Waher.Script.Functions.DateAndTime.ISeconds.
Definition at line 174 of file Duration.cs.
|
getset |
Number of years.
Implements Waher.Script.Functions.DateAndTime.IYears.
Definition at line 129 of file Duration.cs.