Overview
Parses the specified string and returns a DateTimeOffset object.DateTimeOffset DateTimeOffset.parse(val: string)
DateTimeOffset DateTimeOffset.parse(val: string, format: string)
Arguments
string val
date time string
string format
date time format
Returns
DateTimeOffset objectRemarks
If the string is not in a valid format, the method throws an exception.
Example
var dt1 = DateTimeOffset.parse("2012-01-01T00:00:00+03:00");
Example
var dt2 = DateTimeOffset.parse("2012-01-01T00:00:00");
Example
var dt1 = DateTimeOffset.parse("2012-01-01T00:00:00+03:00", "yyyy-MM-ddTHH:mm:sszzz");