Class DateTimeNode
Valued Node representing a Date Time value.
Implements
Inherited Members
Namespace: VDS.RDF.Nodes
Assembly: dotNetRdf.dll
Syntax
public class DateTimeNode : LiteralNode, ILiteralNode, IEquatable<BaseLiteralNode>, IComparable<BaseLiteralNode>, IEquatable<LiteralNode>, IComparable<LiteralNode>, IValuedNode, INode, IComparable<INode>, IComparable<IBlankNode>, IComparable<IGraphLiteralNode>, IComparable<ILiteralNode>, IComparable<IUriNode>, IComparable<IVariableNode>, IComparable<IRefNode>, IComparable<ITripleNode>, IEquatable<INode>, IEquatable<IBlankNode>, IEquatable<IGraphLiteralNode>, IEquatable<ILiteralNode>, IEquatable<IUriNode>, IEquatable<IVariableNode>, IEquatable<IRefNode>, IEquatable<ITripleNode>
Constructors
| Improve this Doc View SourceDateTimeNode(DateTime, DateTimeOffset, string, bool)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTime value, DateTimeOffset offsetValue, string lexicalValue, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | value | Date Time value. |
System.DateTimeOffset | offsetValue | Date Time offset value. |
string | lexicalValue | Lexical Value. |
System.Boolean | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTime, DateTimeOffset, string, Uri, bool)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTime value, DateTimeOffset offsetValue, string lexicalValue, Uri datatype, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | value | Date Time value. |
System.DateTimeOffset | offsetValue | Date Time offset value. |
string | lexicalValue | Lexical Value. |
System.Uri | datatype | Data Type URI. |
System.Boolean | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTime, string, bool)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTime value, string lexicalValue, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | value | Date Time value. |
string | lexicalValue | Lexical Value. |
System.Boolean | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTime, string, Uri, bool)
Creates a new Date Time valued node.
Declaration
protected DateTimeNode(DateTime value, string lexicalValue, Uri datatype, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | value | Date Time value. |
string | lexicalValue | Lexical Value. |
System.Uri | datatype | Datatype URI. |
System.Boolean | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTime, Uri)
Creates a new Date Time valued node.
Declaration
protected DateTimeNode(DateTime value, Uri datatype)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | value | Date Time value. |
System.Uri | datatype | Datatype URI. |
DateTimeNode(DateTime)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTime value)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | value | Date Time value. |
DateTimeNode(DateTimeOffset, string, bool)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTimeOffset value, string lexicalValue, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
System.DateTimeOffset | value | Date Time value. |
string | lexicalValue | Lexical Value. |
System.Boolean | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTimeOffset, string, Uri, bool)
Creates a new Date Time valued node.
Declaration
protected DateTimeNode(DateTimeOffset value, string lexicalValue, Uri datatype, bool normalizeLiteralValue = false)
Parameters
Type | Name | Description |
---|---|---|
System.DateTimeOffset | value | Date Time value. |
string | lexicalValue | Lexical Value. |
System.Uri | datatype | Datatype URI. |
System.Boolean | normalizeLiteralValue | Whether to perform unicode normalization on |
DateTimeNode(DateTimeOffset, Uri)
Creates a new Date Time valued node.
Declaration
protected DateTimeNode(DateTimeOffset value, Uri datatype)
Parameters
Type | Name | Description |
---|---|---|
System.DateTimeOffset | value | Date Time value. |
System.Uri | datatype | Datatype URI. |
DateTimeNode(DateTimeOffset)
Creates a new Date Time valued node.
Declaration
public DateTimeNode(DateTimeOffset value)
Parameters
Type | Name | Description |
---|---|---|
System.DateTimeOffset | value | Date Time value. |
Properties
| Improve this Doc View SourceEffectiveType
Gets the URI of the datatype this valued node represents as a String.
Declaration
public string EffectiveType { get; }
Property Value
Type | Description |
---|---|
string |
NumericType
Gets the numeric type of the node.
Declaration
public SparqlNumericType NumericType { get; }
Property Value
Type | Description |
---|---|
SparqlNumericType |
Methods
| Improve this Doc View SourceAsBoolean()
Throws an error as date times cannot be converted to booleans.
Declaration
public bool AsBoolean()
Returns
Type | Description |
---|---|
System.Boolean |
AsDateTime()
Gets the date time value of the node.
Declaration
public DateTime AsDateTime()
Returns
Type | Description |
---|---|
System.DateTime |
AsDateTimeOffset()
Gets the date time value of the node.
Declaration
public DateTimeOffset AsDateTimeOffset()
Returns
Type | Description |
---|---|
System.DateTimeOffset |
AsDecimal()
Throws an error as date times cannot be converted to decimals.
Declaration
public decimal AsDecimal()
Returns
Type | Description |
---|---|
decimal |
AsDouble()
Throws an error as date times cannot be converted to doubles.
Declaration
public double AsDouble()
Returns
Type | Description |
---|---|
double |
AsFloat()
Throws an error as date times cannot be converted to floats.
Declaration
public float AsFloat()
Returns
Type | Description |
---|---|
float |
AsInteger()
Throws an error as date times cannot be converted to integers.
Declaration
public long AsInteger()
Returns
Type | Description |
---|---|
long |
AsString()
Gets the date time value as a string.
Declaration
public string AsString()
Returns
Type | Description |
---|---|
string |
AsTimeSpan()
Throws an error as date times cannot be cast to a time span.
Declaration
public TimeSpan AsTimeSpan()
Returns
Type | Description |
---|---|
System.TimeSpan |