Android.Text.Format.Time.Parse Method
Parses a date-time string in either the RFC 2445 format or an abbreviated format that does not include the "time" field.

Syntax

[Android.Runtime.Register("parse", "(Ljava/lang/String;)Z", "GetParse_Ljava_lang_String_Handler")]
public virtual bool Parse (string s)

Parameters

s
the string to parse

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Android.Util.TimeFormatExceptionif s cannot be parsed.

Remarks

Parses a date-time string in either the RFC 2445 format or an abbreviated format that does not include the "time" field. For example, all of the following strings are valid:

  • "20081013T160000Z"
  • "20081013T160000"
  • "20081013"
Returns whether or not the time is in UTC (ends with Z). If the string ends with "Z" then the timezone is set to UTC. If the date-time string included only a date and no time field, then the allDay field of this Time class is set to true and the hour, minute, and second fields are set to zero; otherwise (a time field was included in the date-time string) allDay is set to false. The fields weekDay, yearDay, and gmtoff are always set to zero, and the field isDst is set to -1 (unknown). To set those fields, call Time.Normalize(bool) after parsing. To parse a date-time string and convert it to UTC milliseconds, do something like this:

java Example

   Time time = new Time();
   String date = "20081013T160000Z";
   time.parse(date);
   long millis = time.normalize(false);
 

[Android Documentation]

Requirements

Namespace: Android.Text.Format
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 3