DatatypeFactory.NewDurationDayTime Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
NewDurationDayTime(Int64) |
Create a |
NewDurationDayTime(String) |
Create a |
NewDurationDayTime(Boolean, BigInteger, BigInteger, BigInteger, BigInteger) |
Create a |
NewDurationDayTime(Boolean, Int32, Int32, Int32, Int32) |
Create a |
NewDurationDayTime(Int64)
Create a Duration
of type xdt:dayTimeDuration
using the specified milliseconds as defined in
XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration.
[Android.Runtime.Register("newDurationDayTime", "(J)Ljavax/xml/datatype/Duration;", "GetNewDurationDayTime_JHandler")]
public virtual Javax.Xml.Datatype.Duration? NewDurationDayTime (long durationInMilliseconds);
[<Android.Runtime.Register("newDurationDayTime", "(J)Ljavax/xml/datatype/Duration;", "GetNewDurationDayTime_JHandler")>]
abstract member NewDurationDayTime : int64 -> Javax.Xml.Datatype.Duration
override this.NewDurationDayTime : int64 -> Javax.Xml.Datatype.Duration
Parameters
- durationInMilliseconds
- Int64
Milliseconds of Duration
to create.
Returns
New Duration
created with the specified durationInMilliseconds
.
- Attributes
Remarks
Create a Duration
of type xdt:dayTimeDuration
using the specified milliseconds as defined in XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration.
The datatype xdt:dayTimeDuration
is a subtype of xs:duration
whose lexical representation contains only day, hour, minute, and second components. This datatype resides in the namespace http://www.w3.org/2003/11/xpath-datatypes
.
All four values are set by computing their values from the specified milliseconds and are available using the get
methods of the created Duration
. The values conform to and are defined by:
<ul> <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li> <li> W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</li> <li>XMLGregorianCalendar
Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li> </ul>
The default start instance is defined by GregorianCalendar
's use of the start of the epoch: i.e., java.util.Calendar#YEAR
= 1970, java.util.Calendar#MONTH
= java.util.Calendar#JANUARY
, java.util.Calendar#DATE
= 1, etc. This is important as there are variations in the Gregorian Calendar, e.g. leap years have different days in the month = java.util.Calendar#FEBRUARY
so the result of Duration#getDays()
can be influenced.
Any remaining milliseconds after determining the day, hour, minute and second are discarded.
Java documentation for javax.xml.datatype.DatatypeFactory.newDurationDayTime(long)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
NewDurationDayTime(String)
Create a Duration
of type xdt:dayTimeDuration
by parsing its String
representation,
"<em>PnDTnHnMnS</em>",
XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration.
[Android.Runtime.Register("newDurationDayTime", "(Ljava/lang/String;)Ljavax/xml/datatype/Duration;", "GetNewDurationDayTime_Ljava_lang_String_Handler")]
public virtual Javax.Xml.Datatype.Duration? NewDurationDayTime (string? lexicalRepresentation);
[<Android.Runtime.Register("newDurationDayTime", "(Ljava/lang/String;)Ljavax/xml/datatype/Duration;", "GetNewDurationDayTime_Ljava_lang_String_Handler")>]
abstract member NewDurationDayTime : string -> Javax.Xml.Datatype.Duration
override this.NewDurationDayTime : string -> Javax.Xml.Datatype.Duration
Parameters
- lexicalRepresentation
- String
Lexical representation of a duration.
Returns
New Duration
created using the specified lexicalRepresentation
.
- Attributes
Exceptions
If the given string does not conform to the aforementioned specification.
If implementation cannot support requested values.
If lexicalRepresentation
is null
.
Remarks
Create a Duration
of type xdt:dayTimeDuration
by parsing its String
representation, "<em>PnDTnHnMnS</em>", XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration.
The datatype xdt:dayTimeDuration
is a subtype of xs:duration
whose lexical representation contains only day, hour, minute, and second components. This datatype resides in the namespace http://www.w3.org/2003/11/xpath-datatypes
.
All four values are set and available from the created Duration
The XML Schema specification states that values can be of an arbitrary size. Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. An UnsupportedOperationException
will be thrown with a message indicating implementation limits if implementation capacities are exceeded.
Java documentation for javax.xml.datatype.DatatypeFactory.newDurationDayTime(java.lang.String)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
NewDurationDayTime(Boolean, BigInteger, BigInteger, BigInteger, BigInteger)
Create a Duration
of type xdt:dayTimeDuration
using the specified
day
, hour
, minute
and second
as defined in
XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration.
[Android.Runtime.Register("newDurationDayTime", "(ZLjava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;)Ljavax/xml/datatype/Duration;", "GetNewDurationDayTime_ZLjava_math_BigInteger_Ljava_math_BigInteger_Ljava_math_BigInteger_Ljava_math_BigInteger_Handler")]
public virtual Javax.Xml.Datatype.Duration? NewDurationDayTime (bool isPositive, Java.Math.BigInteger? day, Java.Math.BigInteger? hour, Java.Math.BigInteger? minute, Java.Math.BigInteger? second);
[<Android.Runtime.Register("newDurationDayTime", "(ZLjava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;)Ljavax/xml/datatype/Duration;", "GetNewDurationDayTime_ZLjava_math_BigInteger_Ljava_math_BigInteger_Ljava_math_BigInteger_Ljava_math_BigInteger_Handler")>]
abstract member NewDurationDayTime : bool * Java.Math.BigInteger * Java.Math.BigInteger * Java.Math.BigInteger * Java.Math.BigInteger -> Javax.Xml.Datatype.Duration
override this.NewDurationDayTime : bool * Java.Math.BigInteger * Java.Math.BigInteger * Java.Math.BigInteger * Java.Math.BigInteger -> Javax.Xml.Datatype.Duration
Parameters
- isPositive
- Boolean
Set to false
to create a negative duration. When the length
of the duration is zero, this parameter will be ignored.
- day
- BigInteger
Day of Duration
.
- hour
- BigInteger
Hour of Duration
.
- minute
- BigInteger
Minute of Duration
.
- second
- BigInteger
Second of Duration
.
Returns
New Duration
created with the specified day
, hour
, minute
and second
.
- Attributes
Exceptions
If any values would create an invalid Duration
.
If implementation cannot support requested values.
Remarks
Create a Duration
of type xdt:dayTimeDuration
using the specified day
, hour
, minute
and second
as defined in XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration.
The datatype xdt:dayTimeDuration
is a subtype of xs:duration
whose lexical representation contains only day, hour, minute, and second components. This datatype resides in the namespace http://www.w3.org/2003/11/xpath-datatypes
.
The XML Schema specification states that values can be of an arbitrary size. Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. An UnsupportedOperationException
will be thrown with a message indicating implementation limits if implementation capacities are exceeded.
A null
value indicates that field is not set.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
NewDurationDayTime(Boolean, Int32, Int32, Int32, Int32)
Create a Duration
of type xdt:dayTimeDuration
using the specified
day
, hour
, minute
and second
as defined in
XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration.
[Android.Runtime.Register("newDurationDayTime", "(ZIIII)Ljavax/xml/datatype/Duration;", "GetNewDurationDayTime_ZIIIIHandler")]
public virtual Javax.Xml.Datatype.Duration? NewDurationDayTime (bool isPositive, int day, int hour, int minute, int second);
[<Android.Runtime.Register("newDurationDayTime", "(ZIIII)Ljavax/xml/datatype/Duration;", "GetNewDurationDayTime_ZIIIIHandler")>]
abstract member NewDurationDayTime : bool * int * int * int * int -> Javax.Xml.Datatype.Duration
override this.NewDurationDayTime : bool * int * int * int * int -> Javax.Xml.Datatype.Duration
Parameters
- isPositive
- Boolean
Set to false
to create a negative duration. When the length
of the duration is zero, this parameter will be ignored.
- day
- Int32
Day of Duration
.
- hour
- Int32
Hour of Duration
.
- minute
- Int32
Minute of Duration
.
- second
- Int32
Second of Duration
.
Returns
New Duration
created with the specified day
, hour
, minute
and second
.
- Attributes
Exceptions
If any values would create an invalid Duration
.
Remarks
Create a Duration
of type xdt:dayTimeDuration
using the specified day
, hour
, minute
and second
as defined in XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration.
The datatype xdt:dayTimeDuration
is a subtype of xs:duration
whose lexical representation contains only day, hour, minute, and second components. This datatype resides in the namespace http://www.w3.org/2003/11/xpath-datatypes
.
A DatatypeConstants#FIELD_UNDEFINED
value indicates that field is not set.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.