Share via


Time.Parse3339(String) Method

Definition

Parse a time in RFC 3339 format.

[Android.Runtime.Register("parse3339", "(Ljava/lang/String;)Z", "GetParse3339_Ljava_lang_String_Handler")]
public virtual bool Parse3339 (string? s);
[<Android.Runtime.Register("parse3339", "(Ljava/lang/String;)Z", "GetParse3339_Ljava_lang_String_Handler")>]
abstract member Parse3339 : string -> bool
override this.Parse3339 : string -> bool

Parameters

s
String

the string to parse

Returns

true if the resulting time value is in UTC time

Attributes

Exceptions

if s cannot be parsed.

Remarks

Parse a time in RFC 3339 format. This method also parses simple dates (that is, strings that contain no time or time offset). For example, all of the following strings are valid:

<ul> <li>"2008-10-13T16:00:00.000Z"</li> <li>"2008-10-13T16:00:00.000+07:00"</li> <li>"2008-10-13T16:00:00.000-07:00"</li> <li>"2008-10-13"</li> </ul>

If the string contains a time and time offset, then the time offset will be used to convert the time value to UTC.

If the given string contains just a date (with no time field), then the #allDay field is set to true and the #hour, #minute, and #second fields are set to zero.

Returns true if the resulting time value is in UTC time.

Java documentation for android.text.format.Time.parse3339(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