Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Overview

Parses the specified string and returns a DateTimeOffset object.

DateTimeOffset DateTimeOffset.parse(val: string)

Parses the given string in specified format and returns a DateTimeOffset object.

DateTimeOffset DateTimeOffset.parse(val: string, format: string)

Arguments

string val
date time string
string format
date time format

Returns

DateTimeOffset object

Remarks

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");
  • No labels