Skip to content

parseWithCulture

Parses the specified string using culture-specific formatting information and returns a DateTimeOffset object.

DateTimeOffset.parseWithCulture(val: string, culture?: string):DateTimeOffset (DateTimeOffset)

Parameters

string val
    A string representing the date and time.

string culture optional
    A string specifying the culture to use for parsing (e.g., "en-US", "fr-FR"). When omitted on the server, invariant culture is used.

Returns

A DateTimeOffset object representing the parsed date and time.

Remarks

Server workflow scripts only. If the string is not in a valid format, the method throws an exception.

See Also